Re: [PHP] Friday morning brain farts....

2007-08-13 Thread Tijnema
On 8/13/07, tedd [EMAIL PROTECTED] wrote: At 4:54 PM +0200 8/11/07, Tijnema wrote: On 8/11/07, tedd [EMAIL PROTECTED] wrote: At 7:21 PM +0200 8/10/07, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset(

Re: [PHP] Friday morning brain farts....

2007-08-13 Thread tedd
At 12:10 PM +0200 8/13/07, Tijnema wrote: On 8/13/07, tedd [EMAIL PROTECTED] wrote: But, if I see this: if(!isset($argv[1],$argv[2],$argv[3]))) My first thought is Is this OR or AND? And my second thought is If this is OR, then what's AND? Being dyslexic I'm easily confused that way

Re: [PHP] Friday morning brain farts....

2007-08-12 Thread tedd
At 4:54 PM +0200 8/11/07, Tijnema wrote: On 8/11/07, tedd [EMAIL PROTECTED] wrote: At 7:21 PM +0200 8/10/07, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) )

Re: [PHP] Friday morning brain farts....

2007-08-11 Thread tedd
At 11:00 AM -0400 8/10/07, Robert Cummings wrote: On Fri, 2007-08-10 at 10:43 -0400, Jason Pruim wrote: Hi All :) Hope you're not getting sick of my questions as of late, but I keep getting closer and closer and thank you all who have helped me in the past! The only reason I can see this

Re: [PHP] Friday morning brain farts....

2007-08-11 Thread tedd
At 7:21 PM +0200 8/10/07, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) ) if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;) But a bit harder to recognize IMO. :-) Cheers, tedd -- ---

Re: [PHP] Friday morning brain farts....

2007-08-11 Thread Tijnema
On 8/11/07, tedd [EMAIL PROTECTED] wrote: At 7:21 PM +0200 8/10/07, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) ) if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;) But a bit harder to

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Borokov Smith
if (isset($_GET['order'] in_array($_GET['order'], array('Last', 'First', ...))) { $requestedOrder = $_GET['order']; } else { $requestedOrder = your default; } Mind the in_array() call. Always sanitize user input. greetz, boro Jason Pruim schreef: Hi All :) Hope you're not getting sick

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of the error log from the previous day and my first task each day is to go through that and track down any issues that usage has

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 11:40 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: If PHP thinks something might be wrong it will tell you. Why on earth would you want to ignore it? You think you're smarter than PHP?

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Stut
Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: If PHP thinks something might be wrong it will tell you. Why on earth would you want to ignore it? You think you're smarter than PHP? Really? Okay, Stut, let's not make Friday the official Flame Dan Brown holiday this week. I

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 11:40 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: If PHP thinks something might be wrong it will tell you. Why on earth would you want to ignore it? You think you're smarter than PHP? Really? Okay, Stut, let's not make Friday the official

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Tijnema
On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of the error log from the previous day and my first task each day is to go

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 17:39 +0100, Stut wrote: Robert Cummings wrote: On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 17:39 +0100, Stut wrote: Robert Cummings wrote: On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of the error log from the previous day and my first task

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Tijnema
On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 19:21 +0200, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of the error log from the previous day and my first task each day is to go through that and track down any issues that usage has highlighted. That's actually a good point there that I

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Stut [EMAIL PROTECTED] wrote: If PHP thinks something might be wrong it will tell you. Why on earth would you want to ignore it? You think you're smarter than PHP? Really? Okay, Stut, let's not make Friday the official Flame Dan Brown holiday this week. I vote that it should be

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 11:28 -0400, Daniel Brown wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: I never disable E_NOTICE or even E_STRICT. I'm humbled in the presence of greatness. Nothing great about it. It's work as usual. When you're developing the code you see any

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: I never disable E_NOTICE or even E_STRICT. I'm humbled in the presence of greatness. I do my best to ensure that there are no notices or warnings, but I still disable E_NOTICE in general, because I know that it's not going to end the

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 10:43 -0400, Jason Pruim wrote: Hi All :) Hope you're not getting sick of my questions as of late, but I keep getting closer and closer and thank you all who have helped me in the past! The only reason I can see this far is I am standing on the shoulders of

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Stut [EMAIL PROTECTED] wrote: Bad Dan *slap*. Ignoring notices may be detrimental to your health and/or well-being. Better to initialise it with a default if it has not been set in the request. if (!isset($_GET['order'])) $_GET['order'] = 'Last'; Ouch! So you're all

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 11:00 -0400, Daniel Brown wrote: Remember to clean that input before you sit down at the table, there, boy! It's safe to ignore the `Undefined index` notices. That will just appear if a variable is

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 11:00 -0400, Daniel Brown wrote: Remember to clean that input before you sit down at the table, there, boy! It's safe to ignore the `Undefined index` notices. That will just appear if a variable is referenced without first being instantiated or defined. No

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Daniel Brown
On 8/10/07, Jason Pruim [EMAIL PROTECTED] wrote: Hi All :) Hope you're not getting sick of my questions as of late, but I keep getting closer and closer and thank you all who have helped me in the past! The only reason I can see this far is I am standing on the shoulders of giants don't know

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Paul Novitski
At 8/10/2007 07:43 AM, Jason Pruim wrote: I want to be able to sort that info so my sql query looks like: Select * from current order by '$order'; and $order is populated by a GET when they click on a link: A href=index.php?order='Last'Sort by last name/A Now... the whole PHP page is being

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Michael Preslar
Here's what I use to watch my apache logs.. Looks for php errors, notices, and warnings, seg faults, etc.. Grabs the stats for the prior hour and spits them to stdout.. Pipe that to mutt or sendmail and youve got an hourly cron.. Check the command line options for other good stuff.. Only catch:

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 11:18 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: Bad Dan *slap*. Ignoring notices may be detrimental to your health and/or well-being. Better to initialise it with a default if it has not been set in the request. if

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 19:49 +0200, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: I always forget about file_get_contents() because its counterpart file_put_contents() for some ungodly reason didn't appear until PHP 5. Forget PHP4 and life becomes a lot easier :)

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Stut
Robert Cummings wrote: On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of the error log from the previous day and my first task each day is to go through that and track down any issues

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Stut
Daniel Brown wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: I never disable E_NOTICE or even E_STRICT. I'm humbled in the presence of greatness. I do my best to ensure that there are no notices or warnings, but I still disable E_NOTICE in general, because I know that

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Stut
Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: Bad Dan *slap*. Ignoring notices may be detrimental to your health and/or well-being. Better to initialise it with a default if it has not been set in the request. if (!isset($_GET['order'])) $_GET['order'] = 'Last'; Ouch!

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Stut
Daniel Brown wrote: On 8/10/07, Jason Pruim [EMAIL PROTECTED] wrote: Hi All :) Hope you're not getting sick of my questions as of late, but I keep getting closer and closer and thank you all who have helped me in the past! The only reason I can see this far is I am standing on the shoulders of

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Robert Cummings
On Fri, 2007-08-10 at 19:21 +0200, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2007-08-10 at 11:48 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: I get an email from each server containing the contents of the error log from

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Richard Lynch
On Fri, August 10, 2007 9:43 am, Jason Pruim wrote: I want to be able to sort that info so my sql query looks like: Select * from current order by '$order'; and $order is populated by a GET when they click on a link: A href=index.php?order='Last'Sort by last name/A Now... the whole PHP page

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Richard Lynch
On Fri, August 10, 2007 10:00 am, Daniel Brown wrote: It's safe to ignore the `Undefined index` notices. That will just appear if a variable is referenced without first being instantiated or defined. No biggie, just put this at the head of your code: ini_set(error_reporting,E_ALL

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Richard Lynch
On Fri, August 10, 2007 10:18 am, Daniel Brown wrote: So you're all going to tell me that you have E_NOTICE set to report on your sites? Damn right I do! That's the FIRST thing I change on any new development site, anywhere, anytime. -- Some people have a gift link here. Know what I

Re: [PHP] Friday morning brain farts....

2007-08-10 Thread Richard Lynch
On Fri, August 10, 2007 10:43 am, Robert Cummings wrote: On Fri, 2007-08-10 at 11:40 -0400, Daniel Brown wrote: On 8/10/07, Stut [EMAIL PROTECTED] wrote: If PHP thinks something might be wrong it will tell you. Why on earth would you want to ignore it? You think you're smarter than PHP?