Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Crayon Shin Chan
On Thursday 31 May 2007 01:33, Jared Farrish wrote: > Can anybody spot why this doesn't seem to be working right? The manual > ( http://us2.php.net/preg_match) says it returns "false" on error, but > preg_last_error() returns 0, which I assume points to the > "PREG_NO_ERROR" error code. > > > pre

Re: [PHP] using mysql_escape_string with implode() !!

2007-05-30 Thread Greg Donald
On 5/30/07, Jim Lucas <[EMAIL PROTECTED]> wrote: Say I wanted to use this on something other than $_GET, $_POST, & $_COOKIE? Then I suppose you'll have to compensate with updates to support your particular usage. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php

Re: [PHP] Re: Re: Re: preg_match() returns false but no documentation why

2007-05-30 Thread Paul Novitski
Hi Jared, At 5/30/2007 06:00 PM, Jared Farrish wrote: Read the manual: All due respect, I did read it. It's just... a little dense and not practically descriptive. Sorry, I didn't mean to be disrespectful, I thought your question was more elementary than it was. There are, though, a ton of

Re: [PHP] using mysql_escape_string with implode() !!

2007-05-30 Thread Jim Lucas
Greg Donald wrote: On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: You want to use mysql_escape_string, and NOT addslashes and NOT Magic Quotes. function slashes( $var ) { if( is_array( $var ) ) { return array_map( 'slashes', $var ); } else { return mysql_real_escape_string( $v

Re: [PHP] Streaming download to IE doesn't work

2007-05-30 Thread Daniel Kasak
Sorry ... forgot to comment on this ... On Wed, 2007-05-30 at 13:40 -0500, Richard Lynch wrote: > > ... in particular, adding: > > > > header("Cache-control: private"); > > header("Pragma: public"); > > > > fixed things perfectly. Also note that things worked perfectly with > > normal http acces

Re: [PHP] Streaming download to IE doesn't work

2007-05-30 Thread Daniel Kasak
On Wed, 2007-05-30 at 13:40 -0500, Richard Lynch wrote: > On Tue, May 29, 2007 6:37 pm, Daniel Kasak wrote: > > Actually, that blog had absolutely nothing to do with my problem > > ( thanks for RTFP!). Not only that, but the recommendation that I > > construct URLs: > > > > http://address.com/scri

Re: [PHP] using mysql_escape_string with implode() !!

2007-05-30 Thread Greg Donald
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: You want to use mysql_escape_string, and NOT addslashes and NOT Magic Quotes. function slashes( $var ) { if( is_array( $var ) ) { return array_map( 'slashes', $var ); } else { return mysql_real_escape_string( $var ); } } set_magi

[PHP] Re: Re: Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
Read the manual: All due respect, I did read it. It's just... a little dense and not practically descriptive. Maybe it's more practical to ask, "When is it practical to use it?" It matches anything, so I assume that means you can use it to match, say, a paragraph that you can't predict or matc

Re: [PHP] Re: Re: preg_match() returns false but no documentation why

2007-05-30 Thread Paul Novitski
At 5/30/2007 05:08 PM, Jared Farrish wrote: So what does the definition I posted mean for non-bracketed periods? Does it mean it will match anything but a line or return break character? How in practice is this useful? Read the manual: Pattern Syntax http://www.php.net/manual/en/reference.pcre

[PHP] Re: Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
If the pattern delimiter character appears in the pattern it must be escaped so that the regexp processor will correctly interpret it as a pattern character and not as the end of the pattern. This would produce a regexp error: /ldap://*/ but this is OK: /ldap:\/\/*/ Therefor

Re: [PHP] Re: preg_match() returns false but no documentation why

2007-05-30 Thread Paul Novitski
On 5/30/07, Jim Lucas <[EMAIL PROTECTED]> wrote: The op will need to use something other than forward slashes. At 5/30/2007 03:26 PM, Jared Farrish wrote: You mean the delimiters (a la Richard's suggestion about using '|')? Hi Jared, If the pattern delimiter character appears in the pat

Re: [PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
On 5/30/07, Afan Pasalic <[EMAIL PROTECTED]> wrote: email has to match "in total". [EMAIL PROTECTED] and [EMAIL PROTECTED] are NOT the same in my case. thanks jared, If you can match a person by their email, why not just SELECT by email only (and return the persons information)? Consider, as

[PHP] Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
On 5/30/07, Jim Lucas <[EMAIL PROTECTED]> wrote: The op will need to use something other than forward slashes. You mean the delimiters (a la Richard's suggestion about using '|')? so, this is going to match: ldap://testing123.com TRUE ldap://www.testing-123.com FALSE ldap://t

Re: [PHP] Re: find (matching) person in other table

2007-05-30 Thread Afan Pasalic
Jared Farrish wrote: On 5/30/07, Afan Pasalic <[EMAIL PROTECTED]> wrote: yes. in one hand it's more for mysql list. though, I was thinking more if somebody had already something similar as a "project". more as path I have to follow. e.g., in your example, in where clause AND doesn't work bec

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jim Lucas
Stut wrote: Jared Farrish wrote: On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote: > > preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server) You are missing the start/end delimiters is your first problem... Which ones? I

Re: [PHP] OOB problem, super stumped.

2007-05-30 Thread Jim Lucas
Brian Seymour wrote: Jim, I put the link identifier back and made your recommended changes and now everything works perfect. Can't thank you enough. Is the reason you have to call the parents __construct() method because the open mysql connection only exists within the scope of the object it was

Re: [PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
On 5/30/07, Afan Pasalic <[EMAIL PROTECTED]> wrote: yes. in one hand it's more for mysql list. though, I was thinking more if somebody had already something similar as a "project". more as path I have to follow. e.g., in your example, in where clause AND doesn't work because bob could be robert

Re: [PHP] exec dont work for svn

2007-05-30 Thread Manolet Gmail
2007/5/30, Richard Lynch <[EMAIL PROTECTED]>: On Tue, May 29, 2007 10:44 am, Manolet Gmail wrote: > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: >> On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: >> > but this doesnt work: >> > >> > exec("svn update",$out); exec("svn update", $out, $error)

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: If you can't find them documented, print them out: echo "PREG_NO_ERROR: '", PREG_NO_ERROR, '"; Doh! PREG_NO_ERROR: 0 PREG_INTERNAL_ERROR: 1 PREG_BACKTRACK_LIMIT_ERROR: 2 PREG_RECURSION_LIMIT_ERROR: 3 PREG_BAD_UTF8_ERROR: 4 So apparently,

Re: [PHP] find (matching) person in other table

2007-05-30 Thread Afan Pasalic
Richard Lynch wrote: On Wed, May 30, 2007 3:30 pm, Afan Pasalic wrote: hi, the code I'm working on has to compare entered info from registration form with data in members table and list to administrator (my client) all "matching" people. admin then has to decide is person who registered alrea

RE: [PHP] OOB problem, super stumped.

2007-05-30 Thread Brian Seymour
Jim, I put the link identifier back and made your recommended changes and now everything works perfect. Can't thank you enough. Is the reason you have to call the parents __construct() method because the open mysql connection only exists within the scope of the object it was created in, unless spe

Re: [PHP] Re: find (matching) person in other table

2007-05-30 Thread Afan Pasalic
Jared Farrish wrote: I was thinking to assign points (percentage) to matching fields (last name, first name, email, phone, city, zip, phone) and then list people with more than 50%. e.g., if first and last name match - 75%, if only email match - 85%, if first name, last name and email match - 100

Re: [PHP] find (matching) person in other table

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 3:30 pm, Afan Pasalic wrote: > hi, > the code I'm working on has to compare entered info from registration > form with data in members table and list to administrator (my client) > all "matching" people. admin then has to decide is person who > registered > already in database

[PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
On 5/30/07, Jared Farrish <[EMAIL PROTECTED]> wrote: $lastname = strpos('Rogers',0,2); $firstname = strpos('Timothy',0,2); $select = "SELECT `uid`,`LastName`,`FirstName` FROM `users` WHERE LastName='$lastname%' AND FirstName='$firstname%'"; Stri

Re: [PHP] ini_set() security question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 3:34 pm, Samuel Vogel wrote: >> And what happens if you try to allocate 3M of data? >> >> $foo = str_repeat('.', 3145728); >> > Nothing. It does it without any errors. I can allocate up to 20MB > (well > a little bit less of course). Check http://bugs.php.net and see if it's a

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 3:25 pm, Jared Farrish wrote: > On 5/30/07, Stut <[EMAIL PROTECTED]> wrote: >> >> You need delimiters around the regex, as stated in the >> documentation. >> >> preg_match("/^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/",$this->server) >> >> Although you don't need to use slashes

[PHP] Re: find (matching) person in other table

2007-05-30 Thread Jared Farrish
I was thinking to assign points (percentage) to matching fields (last name, first name, email, phone, city, zip, phone) and then list people with more than 50%. e.g., if first and last name match - 75%, if only email match - 85%, if first name, last name and email match - 100%, if last name and ph

Re: [PHP] ini_set() security question

2007-05-30 Thread Samuel Vogel
Hi! Show us your test code? /etc/apache2/httpd.conf : php_admin_value memory_limit 3145728 iniset_test.php : new: ".$new; ?> The result is the following: old: 3145728 new: 20971520 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] setting windows folder to chmod 644

2007-05-30 Thread Richard Lynch
On Fri, May 25, 2007 4:38 am, blueboy wrote: > How can I do the equivalent of this in windows or is there a tool I > can > use? Install Cygwin? :-) Windows permission system, or lack thereof, depeonds on which version of Windows you are running. So you need to tell us, or just do what everybody

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Philip Thompson
On May 30, 2007, at 6:32 AM, Richard Davey wrote: Hi Dave, Wednesday, May 30, 2007, 12:20:48 PM, you wrote: If there is no need to return a value then I don't do so. However, the function is going to process something, and surely you should check that the processing has succeeded or faile

Re: [PHP] ini_set() security question

2007-05-30 Thread Samuel Vogel
And what happens if you try to allocate 3M of data? $foo = str_repeat('.', 3145728); Nothing. It does it without any errors. I can allocate up to 20MB (well a little bit less of course). Regards, Samy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php

Re: [PHP] Form Validation Issues

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 12:05 am, Greg Donald wrote: > On 5/24/07, Robert Cummings <[EMAIL PROTECTED]> wrote: >> *lol* You must have missed the other thread... hence the wink on the >> end :) > > I'm guessing not everyone uses a threaded email client. And some > people always feel the need to post th

[PHP] find (matching) person in other table

2007-05-30 Thread Afan Pasalic
hi, the code I'm working on has to compare entered info from registration form with data in members table and list to administrator (my client) all "matching" people. admin then has to decide is person who registered already in database and assign his/her member_id or the registered person is

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
On 5/30/07, Stut <[EMAIL PROTECTED]> wrote: You need delimiters around the regex, as stated in the documentation. preg_match("/^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/",$this->server) Although you don't need to use slashes, you can use any character you want but you must escape it in if it

Re: [PHP] ini_set() security question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 2:59 pm, Samuel Vogel wrote: > Hi! >> Show us your test code? >> > /etc/apache2/httpd.conf : > php_admin_value memory_limit 3145728 > > iniset_test.php : > > $old = ini_set("memory_limit", 20971520); > > echo "old: ".$old; > > $new = ini_get("memory_limit"); > > echo "new: ".$

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 3:06 pm, Jared Farrish wrote: > On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote: >> > >> > preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server) >> >> You are missing the start/end delimiters is your

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Stut
Jared Farrish wrote: On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote: > > preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server) You are missing the start/end delimiters is your first problem... Which ones? I've got the s

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote: > > preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server) You are missing the start/end delimiters is your first problem... Which ones? I've got the starter "^" and the clo

Re: [PHP] using mysql_escape_string with implode() !!

2007-05-30 Thread Richard Lynch
You want to use mysql_escape_string, and NOT addslashes and NOT Magic Quotes. On Fri, May 25, 2007 12:34 pm, Rahul Sitaram Johari wrote: > > Ok, I'm not able to use array_map() at all to my benefit, or at least > I > can't figure out how to. > > I'm trying to generate the string with escape slashe

Re: [PHP] using mysql_escape_string with implode() !!

2007-05-30 Thread Richard Lynch
On Fri, May 25, 2007 10:32 am, Rahul Sitaram Johari wrote: > > Ave, > > I¹m inserting values out of an array into mySQL. There¹s other values > besides the array values that are being inserted as well. This is my > simple > INSERT code: array_map('mysql_real_escape_string', $var); This assumes

Re: [PHP] Re: a question on session ID and security

2007-05-30 Thread Jared Farrish
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:> If they can get the first cookie, they can get the second just as easily. I thought this said "just as weasily" at first, and I thought, "Ain't that the truth..." -- Jared Farrish Intermediate Web Developer Denton, Tx Abraham Maslow: "If the

Re: [PHP] ini_set() security question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 2:44 pm, Samuel Vogel wrote: >>> I would like to allow the users to ini_set(), while disabling the >>> risky >>> options with php_admin_flag/value! >>> >> >> I don't think php_admin_* can be over-ridden -- that's kinda the >> whole >> point of that. > > The Problem is, that i

Re: [PHP] Tracking exit links with php?

2007-05-30 Thread Richard Lynch
Google-analytics :-) On Mon, May 28, 2007 8:37 am, Merlin wrote: > Hi there, > > I am wondering if it is possible to track links on for example google > adsense as exit URLs with PHP. You can track referers, I know, but > what > about the adsense banner on your pages. Did you ever wonder which page

Re: [PHP] Unknown number of check boxes?

2007-05-30 Thread Richard Lynch
On Mon, May 28, 2007 1:37 pm, Søren Neigaard wrote: > I would like to have a unknown number of generated check boxes like > this: > > > > > > And the name will be generated "chk01 to chk99", but how do I make > the receiving PHP script that "scans" for post variables that are > sent, so that I c

Re: [PHP] ini_set() security question

2007-05-30 Thread Samuel Vogel
Hello, I would like to allow the users to ini_set(), while disabling the risky options with php_admin_flag/value! I don't think php_admin_* can be over-ridden -- that's kinda the whole point of that. The Problem is, that i can be overwritten using ini_set()... I just found that out by t

Re: [PHP] exec dont work for svn

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 10:44 am, Manolet Gmail wrote: > 2007/5/28, Greg Donald <[EMAIL PROTECTED]>: >> On 5/28/07, Manolet Gmail <[EMAIL PROTECTED]> wrote: >> > but this doesnt work: >> > >> > exec("svn update",$out); exec("svn update", $out, $error); if ($error) echo "OS Error: $error. Use perro

Re: [PHP] exec dont work for svn

2007-05-30 Thread Richard Lynch
Did 'nobody' do the initial checkout? If not, 'nobody' probably can't have permission to do the update. On Mon, May 28, 2007 5:34 pm, Manolet Gmail wrote: > hi, i want to do a svn update (subversion) from php using exec (or > system) > > now, this works: > > exec("ls; pwd",$out); > foreach($out a

Re: [PHP] php execute command on server

2007-05-30 Thread Richard Lynch
On Mon, May 28, 2007 6:02 pm, Jody Gugelhupf wrote: > vlc command itself executed on my machine from the console shows that > the command works fine, this > probably means that somehting is wrong with my php file. Not necessarily all that useful... PHP runs as a different user in a different envi

Re: [PHP] Re: a question on session ID and security

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 10:36 am, Jared Farrish wrote: >> But the point here is that both pieces of information required to >> authenticate that client are stored on the client. If someone can >> get >> one of them they can get the other, so it's no more secure than just >> accepting the one cookie wi

Re: [PHP] Sessions VS MySQL

2007-05-30 Thread Matt Fielding
As far as scalability goes, there's actually a game we're referencing a lot to help us make it work at the get go called Kingdom of Loathing ( http://www.kingdomofloathing.com ). This game seems to have on average around 1,000-1,500 users on at any given time. I've noticed when visiting the page a

Re: [PHP] Re: a question on session ID and security

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 7:42 am, Stut wrote: > Here one final thought... if there was a reliable way to add security > to > sessions don't you think that one of the multitude of web development > languages out there would have done it, including PHP? Several reliable security additions have been disc

Re: [PHP] a question on session ID and security

2007-05-30 Thread Richard Lynch
On Mon, May 28, 2007 6:46 pm, Davis Chan wrote: > Hi! I am developing a site with some authenticated users only > features. > I would like to know if the following is true: > > 1. script for login process is located on a SSL-enabled server, so > usernames and passwords are encrypted. > 2. upon succ

Re: [PHP] Client does not support authentication protocol...

2007-05-30 Thread Richard Lynch
On Mon, May 28, 2007 9:52 pm, Tom wrote: > Hi, as always, I'm trying to connect to a MySQL database in the > following > way: > > mysql_connect('host','user','password'); > > In my local PC this Works perfectly, but in the server I receipt the > following error: > > mysql_connect(): Client does not

Re: [PHP] RE: Return or not to return, that is the question

2007-05-30 Thread Robert Cummings
On Wed, 2007-05-30 at 17:24 +0100, Richard Davey wrote: > Hi Jared, > > Wednesday, May 30, 2007, 4:10:45 PM, you wrote: > > [snip] > > I think putting "return;" at the end of every function is probably a healthy > > practice, but is it best practice? If it's poorly written and/or poorly > > facto

Re: [PHP] Streaming download to IE doesn't work

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 6:37 pm, Daniel Kasak wrote: > Actually, that blog had absolutely nothing to do with my problem > ( thanks for RTFP!). Not only that, but the recommendation that I > construct URLs: > > http://address.com/script/thing=2/this=3/that=4/download.txt > > is patently ridiculous. Wh

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Paul Novitski
At 5/30/2007 10:51 AM, Richard Lynch wrote: On Wed, May 30, 2007 12:00 pm, Paul Novitski wrote: [snip] use the archives Good suggestion! HOWEVER: it is not a good idea, imho, to "always" let the errors bubble up to the outer layer, which is what Paul seemed to have typed... But didn't.

Re: [PHP] Streaming download to IE doesn't work

2007-05-30 Thread Richard Lynch
On Mon, May 28, 2007 10:30 pm, Daniel Kasak wrote: > Hi all. > > I'm streaming a file ( location of which is to be hidden from clients, > hence the need to stream ). Basically I'm doing: Actually, you're forcing a download, rather than streaming it... > session_start(); > // some authentication s

Re: [PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote: > Hi all, > > Can anybody spot why this doesn't seem to be working right? The manual > ( > http://us2.php.net/preg_match) says it returns "false" on error, but > preg_last_error() returns 0, which I assume points to the > "PREG_NO_ERROR" > error c

RE: [PHP] OOB problem, super stumped. (resolved)

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 10:07 pm, Brian Seymour wrote: > Strangely enough the only thing that was wrong was: > > $this->result=mysql_query($query, $this->conx); > > I removed $this->conx so it looked like > > $this->result=mysql_query($query); Put that back!!! Otherwise, when you add some *OTHER*

Re: [PHP] php via cmdline including unwanted headers

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 2:47 am, Sebe wrote: > Yeni Setiawan wrote: >> >> >> On 5/30/07, *Sebe* <[EMAIL PROTECTED] > >> wrote: >> >> I run some scripts via php (cgi) which sends output to another >> file, but >> it's including unwanted cookie header, etc in the

Re: [PHP] php via cmdline including unwanted headers

2007-05-30 Thread Richard Lynch
php -q On Wed, May 30, 2007 1:11 am, Sebe wrote: > I run some scripts via php (cgi) which sends output to another file, > but > it's including unwanted cookie header, etc in the outfile. > > example: > > php /home/dev/script.php > /home/production/feeds/news.xml 2>&1 > > and at the top of news.xml

Re: [PHP] checkboxes problem

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 3:59 am, blueboy wrote: > Hi, > > I have a checkbox array (about 20 lines) > > input name=\"box\" type=\"checkbox\" value=\"$id\"> > input name=\"box\" type=\"checkbox\" value=\"$id\"> > input name=\"box\" type=\"checkbox\" value=\"$id\"> > > I do some client side checking wi

Re: [PHP] Sessions VS MySQL

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 4:00 am, Matt Fielding wrote: > I've recently begun work on a web-based RPG game with some friends, > and have > recently been thinking about the best solution for loading and saving > persistent variables like player life/stats and other information. I > am both > familiar wit

RE: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 7:56 am, Jay Blanchard wrote: > Classically this would need a return, because $this->counter is going > to > be less than 100 most of the time, and you may want to return the > value > at some point. Or you may not ever need to return it. And if you return it for no reason, y

Re: [PHP] uploading really big files

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 8:47 am, Angelo Zanetti wrote: > We need to develop a system where we can upload really big files. IE > 15 > - 25 Mb. You're pushing the limit on user patience and browser timeouts... > So I know you can set the limit of the upload thats not a problem, I > know a problem that

[PHP] preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
Hi all, Can anybody spot why this doesn't seem to be working right? The manual ( http://us2.php.net/preg_match) says it returns "false" on error, but preg_last_error() returns 0, which I assume points to the "PREG_NO_ERROR" error code. preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$th

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 12:00 pm, Paul Novitski wrote: [snip] use the archives I think there is a LOT of value in bubbling up errors to the appropriate level of handling, and letting the right layer do the right job for the error. HOWEVER: it is not a good idea, imho, to "always" let the errors bubb

Re: Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 10:25 am, Richard Davey wrote: > Hi Paul, > > Wednesday, May 30, 2007, 4:07:00 PM, you wrote: > >> I demur at your final point: If we don't use exit() and the >> function >> performs non-aborting error handling, it's going to return to the >> calling function which in most cas

[PHP] Re: RE: Return or not to return, that is the question

2007-05-30 Thread Jared Farrish
My rule is to write what you mean, and if you don't mean to return anything valid or worth anything, just don't. If you explicitly put a return it should be for a reason, whatever you return should be meaningful. If I find a 'return true' at the end of a piece of code, I will check if there i

Re: [PHP] RE: Return or not to return, that is the question

2007-05-30 Thread Satyam
- Original Message - From: "Richard Davey" <[EMAIL PROTECTED]> That is all my original thread was ever really asking - I was just curious what other people thought about returning from functions that don't actually require a return value. So far the responses have been pretty varied, from

Re: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 7:42 am, Darren Whitlen wrote: > Chris Boget wrote: >>> If there is no need to return a value then I don't do >>> so. However, the function is going to process something, >>> and surely you should check that the processing has >>> succeeded or failed? >> >> This is precisely th

Re: [PHP] Best way to convert Little-Endian DWORD to string

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 9:19 am, Tijnema wrote: > Maybe quite strange question and quite off topic, but there's PHP > involved :) > > I want to read out files, and then I come across 4byte DWORD values, > they are stored in little endian values, but how do I get in a PHP > string (as the values are to

Re: [PHP] @imap_headerinfo->date

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 1:12 pm, Umar wrote: > Dear Members! > > When I try to get email date through @imap_headerinfo the output > like this > > Wed, 30 May 2007 01:14:03 +0900 > Tue, 29 May 2007 22:31:43 +0500 > > But i want to change it e.g on current date it should be only time >

Re: [PHP] ini_set() security question

2007-05-30 Thread Richard Lynch
On Tue, May 29, 2007 10:19 am, Samuel Vogel wrote: > I would be very interested in knowing which options, that are > accessible > with PHP_INI_ALL or PHP_INI_PERDIR, could be risky to allow on a > shared > hosting server. php.ini_recommended is a good starting point, I think... > I would like to

Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Paul Novitski
At 5/30/2007 08:25 AM, Richard Davey wrote: > In order that displayData() doesn't fall on its face, I would write > the parent function in one of these ways: > if (lookUpData()) displayData(); That's where our approach differs. If lookUpData falls flat on its face, my error handler wil

[PHP] Re: RE: Return or not to return, that is the question

2007-05-30 Thread Jared Farrish
Hi Jared, Hi Rich! If you do put a return; at the end of all of your functions, I'm curious as to why? If a function doesn't actually return a value (which is highly possible) then it isn't /required/, but that doesn't stop me from doing it. I *do* put 'return;' at the end of all functions (my

Re: [PHP] RE: Return or not to return, that is the question

2007-05-30 Thread Richard Davey
Hi Jared, Wednesday, May 30, 2007, 4:10:45 PM, you wrote: [snip] > I think putting "return;" at the end of every function is probably a healthy > practice, but is it best practice? If it's poorly written and/or poorly > factored code, it doesn't make any difference if they have returns on > every

Re: [PHP] Best way to convert Little-Endian DWORD to string

2007-05-30 Thread Tijnema
On 5/30/07, Edward Kay <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Tijnema [mailto:[EMAIL PROTECTED] > Sent: 30 May 2007 15:20 > To: php > Subject: [PHP] Best way to convert Little-Endian DWORD to string > > > Hi, > > Maybe quite strange question and quite off topic, but the

RE: [PHP] Best way to convert Little-Endian DWORD to string

2007-05-30 Thread Edward Kay
> -Original Message- > From: Tijnema [mailto:[EMAIL PROTECTED] > Sent: 30 May 2007 15:20 > To: php > Subject: [PHP] Best way to convert Little-Endian DWORD to string > > > Hi, > > Maybe quite strange question and quite off topic, but there's PHP > involved :) > > I want to read out f

[PHP] Re: scheduling a script to check a directory for files

2007-05-30 Thread Jared Farrish
On linux Our webmaster actually sets up a cron to call a Lynx browser that navigates to the page. How he did this, I'm not sure (me windows, linux NO!), but at the time, cron didn't cut it (for some reason), where Lynx worked perfectly. Probably had something to do with not using CLI to handle t

Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Davey
Hi Paul, Wednesday, May 30, 2007, 4:07:00 PM, you wrote: > I demur at your final point: If we don't use exit() and the function > performs non-aborting error handling, it's going to return to the > calling function which in most cases will need to know whether its > child function succeeded or

[PHP] RE: Return or not to return, that is the question

2007-05-30 Thread Jared Farrish
Even the most simple function can have more than one failure point within it. If you aren't handling the errors yourself within the function, you're returning false all over the place and then having to do the same checking from whatever called it - duplicated however many times you call that fun

Re: [PHP] Return or not to return, that is the question

2007-05-30 Thread Paul Novitski
At 5/30/2007 05:41 AM, Richard Davey wrote: /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } If that was wrapped in a function, sticking 'return false' within the connect_error check is useful why exactly? Equally the

Re: [PHP] Re: Too many records to display in one web page

2007-05-30 Thread Steve
Very true. I completely forgot to mention that :( "Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Steve wrote: >> The way I handle it: >> >> Step 1- >> Add SELECT SQL_CALC_FOUND_ROWS to the front of your initial query and add >> the pagination limit to the end (LIMIT 200,

Re: [PHP] uploading really big files

2007-05-30 Thread Zoltán Németh
2007. 05. 30, szerda keltezéssel 15.47-kor Angelo Zanetti ezt írta: > Dear all > > We need to develop a system where we can upload really big files. IE 15 > - 25 Mb. > So I know you can set the limit of the upload thats not a problem, I > know a problem that we might experience is that the brows

Re: [PHP] uploading really big files

2007-05-30 Thread Tijnema
On 5/30/07, Angelo Zanetti <[EMAIL PROTECTED]> wrote: Dear all We need to develop a system where we can upload really big files. IE 15 - 25 Mb. So I know you can set the limit of the upload thats not a problem, I know a problem that we might experience is that the browser might time out. Is ther

[PHP] Best way to convert Little-Endian DWORD to string

2007-05-30 Thread Tijnema
Hi, Maybe quite strange question and quite off topic, but there's PHP involved :) I want to read out files, and then I come across 4byte DWORD values, they are stored in little endian values, but how do I get in a PHP string (as the values are too large for integer) My code is currently this: $

[PHP] uploading really big files

2007-05-30 Thread Angelo Zanetti
Dear all We need to develop a system where we can upload really big files. IE 15 - 25 Mb. So I know you can set the limit of the upload thats not a problem, I know a problem that we might experience is that the browser might time out. Is there any way around this? and also are there other prob

Re: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 5:52 am, Richard Davey wrote: > Just a quick straw-poll really: > > What is your take on using 'return' when you end a function, if you > don't actually need to return a value? > > If you have to return say a true/false as the result of an operation, > then it's an obvious choi

Re: [PHP] scheduling a script to check a directory for files

2007-05-30 Thread Richard Lynch
On Wed, May 30, 2007 7:14 am, Bosky, Dave wrote: > I need to write a script to import '.csv' data files into MySQL. > > My question is how can I have a script execute and check a directory > every 4 hours for any '.csv' files and if it finds any calls a > function > to import them? Linux: man 5 cr

Re: [PHP] php via cmdline including unwanted headers

2007-05-30 Thread Robert Cummings
On Wed, 2007-05-30 at 09:38 +0100, Stut wrote: > Sebe wrote: > > > > i tried using -q > > still shows the headers.. this problem started when i switched to php cgi. > > Well that's your mistake. The CGI binary is meant for use as a web page > generator. You need php-cli. While php-cli is an impr

Re: [PHP] scheduling a script to check a directory for files

2007-05-30 Thread Marc Weber
> I need to write a script to import '.csv' data files into MySQL. > > My question is how can I have a script execute and check a directory > every 4 hours for any '.csv' files and if it finds any calls a function > to import them? On linux there is cron (you should find many example by googling)

RE: [PHP] Return or not to return, that is the question

2007-05-30 Thread Jay Blanchard
[snip] All depends on the function. function someFunc(){ $this->counter++; if($this->counter > 100) $this->counter = 0; } Something that simple wont need a return at all. [/snip] Classically this would need a return, because $this->counter is going to be less than 100 most of th

Re: [PHP] Return or not to return, that is the question

2007-05-30 Thread Darren Whitlen
Chris Boget wrote: If there is no need to return a value then I don't do so. However, the function is going to process something, and surely you should check that the processing has succeeded or failed? This is precisely the point I was going to make. Unless an argument is passed in by refer

Re[2]: [PHP] Return or not to return, that is the question

2007-05-30 Thread Richard Davey
Hi Chris, Wednesday, May 30, 2007, 1:17:39 PM, you wrote: >> If there is no need to return a value then I don't do >> so. However, the function is going to process something, >> and surely you should check that the processing has >> succeeded or failed? > This is precisely the point I was goi

Re: [PHP] scheduling a script to check a directory for files

2007-05-30 Thread Auto-Deppe, C. Haensel
On a *nix-box it's fairly simple when using cronjobs... maybe try that? - Original Message - From: "Bosky, Dave" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 30, 2007 2:14 PM Subject: [PHP] scheduling a script to check a directory for files Greetings! I need to write a script to i

RE: [PHP] Return or not to return, that is the question

2007-05-30 Thread Chris Boget
> If there is no need to return a value then I don't do > so. However, the function is going to process something, > and surely you should check that the processing has > succeeded or failed? This is precisely the point I was going to make. Unless an argument is passed in by reference for mani

[PHP] Query Regarding How to contribute towards a bug fix: Sachin

2007-05-30 Thread Sachin mahajan
I have tried to share my experience over a problem related to sessions but was unable to submit as the SPAM question is really very confusing. So I am just submitting it here:- Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advise

[PHP] scheduling a script to check a directory for files

2007-05-30 Thread Bosky, Dave
Greetings! I need to write a script to import '.csv' data files into MySQL. My question is how can I have a script execute and check a directory every 4 hours for any '.csv' files and if it finds any calls a function to import them? Thanks, Dave *

Re: [PHP] Return or not to return, that is the question

2007-05-30 Thread Zoltán Németh
2007. 05. 30, szerda keltezéssel 11.52-kor Richard Davey ezt írta: > Hi all, > > Just a quick straw-poll really: > > What is your take on using 'return' when you end a function, if you > don't actually need to return a value? > > If you have to return say a true/false as the result of an operati

  1   2   >