Re: [PHP] Debugging Help Needed

2011-04-12 Thread Paul M Foster
On Tue, Apr 12, 2011 at 03:37:26PM -0700, Rich Shepard wrote: > On Tue, 12 Apr 2011, Daniel Brown wrote: > > > You missed the ending semicolon, that's all. > > Daniel, > > Oops! Too long since C and Python doesn't use semicolons. Wait, what?! Did they change C? When did this happen?! ;-}

Re: [PHP] Debugging Help Needed

2011-04-12 Thread Rich Shepard
On Tue, 12 Apr 2011, Daniel Brown wrote: You missed the ending semicolon, that's all. Daniel, Oops! Too long since C and Python doesn't use semicolons. Adding that, I remove the error but do not see the printed backtrace. Please suggest how I can determine the source of the page not f

Re: [PHP] Debugging Help Needed

2011-04-12 Thread Daniel Brown
On Tue, Apr 12, 2011 at 18:29, Rich Shepard wrote: > >  Looking at the PHP manual I see there's a function called > debug_print_backtrace(), but I have not found how to properly use it. When I > insert it at the top of ErrorHandler404(), php throws an error when I try to > run index.php: > > funct

[PHP] Debugging Help Needed

2011-04-12 Thread Rich Shepard
I'm not a PHP coder, but I have an application written in PHP (CMS Made Simple) that stopped working when I upgraded postgres to 9.x. I seem to have most of the problems fixed (those with adodb_lite) but now need to track down why I get a "404 Page Not Found" error when I try to invoke the local

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Richard Quadling
On 12 April 2011 20:00, David Harkness wrote: > On Tue, Apr 12, 2011 at 6:34 AM, Richard Quadling > wrote: >> >> Without running the code, can you say what the output will be in the 3 >> examples? > > Yes, but I would still rewrite that code. ;) I typically reserve the ternary > operator to retur

Re: [PHP] a shortcut to set variable

2011-04-12 Thread David Harkness
On Tue, Apr 12, 2011 at 6:34 AM, Richard Quadling wrote: > Without running the code, can you say what the output will be in the 3 > examples? > Yes, but I would still rewrite that code. ;) I typically reserve the ternary operator to return a value or assign a variable. Given that it is used less

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Richard Quadling
On 12 April 2011 14:25, tedd wrote: > At 12:47 PM +0100 4/12/11, Richard Quadling wrote: >> >> Putting () around ternary's is a "best practise". >> >> > echo 'Are we ready to go? ', isset($go) ? 'Yes we are.' : 'No we are >> not.', ' Ready state completed', PHP_EOL; >> $go = true; >> echo 'Are we

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
On 12 April 2011 13:29, Eli Orr wrote: > Hi Richard, > > Thanks. > I've already got a solution to simply use Notes++ and save the PHP script > with Save As encoding set to ANSI (It was UTF-8 indeed that creates the > BOM...). > > Thanks again > > Eli > > -Original Message- > From: Richard

Re: [PHP] a shortcut to set variable

2011-04-12 Thread tedd
At 12:47 PM +0100 4/12/11, Richard Quadling wrote: Putting () around ternary's is a "best practise". vs. vs. Don't run them just yet. Can you quickly and easily see the output? Argg! :-) $ready = 'Are we ready to go? '; $yes = 'Yes we are.'; $no = 'No we are not.' echo($ready); ech

RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Hi Richard, Thanks. I've already got a solution to simply use Notes++ and save the PHP script with Save As encoding set to ANSI (It was UTF-8 indeed that creates the BOM...). Thanks again Eli -Original Message- From: Richard Quadling [mailto:rquadl...@gmail.com] Sent: Tuesday, April

RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Thanks Richard, Do you know a technique to mirror all the echo strings into a file for debugging ? Eli -Original Message- From: Richard Quadling [mailto:rquadl...@gmail.com] Sent: Tuesday, April 12, 2011 2:51 PM To: Eli Orr Cc: php-general@lists.php.net Subject: Re: [PHP] Eliminatim

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
On 12 April 2011 12:50, Richard Quadling wrote: > On 12 April 2011 11:59, Eli Orr wrote: >> >> Hi Richard, >> >> Thanks. >> Indeed, that is the case - I've included a code that has UTF-8 string >> contants -so I guess the PHP >> parser set the UTF-8 mode to ON so that the returned string to the

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
On 12 April 2011 11:59, Eli Orr wrote: > > Hi Richard, > > Thanks. > Indeed, that is the case - I've included a code that has UTF-8 string > contants -so I guess the PHP > parser set the UTF-8 mode to ON so that the returned string to the client has > the UTF-8 BOM. > > It is not a big issue as

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Richard Quadling
On 12 April 2011 11:57, Stuart Dallas wrote: > On Tuesday, 12 April 2011 at 11:52, tedd wrote: > At 11:06 AM +0100 4/12/11, Stuart Dallas wrote: >> > On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: >> > eh, I just want to get a shortcut like >> > > >> > >  $id = isset($_GET['id']) ? $_GET['

RE: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Hi Richard, Thanks. Indeed, that is the case - I've included a code that has UTF-8 string contants -so I guess the PHP parser set the UTF-8 mode to ON so that the returned string to the client has the UTF-8 BOM. It is not a big issue as the mobile app guys aware of this and make the proper

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Stuart Dallas
On Tuesday, 12 April 2011 at 11:52, tedd wrote: At 11:06 AM +0100 4/12/11, Stuart Dallas wrote: > > On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: > > eh, I just want to get a shortcut like > > > > > > $id = isset($_GET['id']) ? $_GET['id'] : 0; > > > > > > > > > BTW, I'm using PHP5.3+

Re: [PHP] a shortcut to set variable

2011-04-12 Thread tedd
At 11:06 AM +0100 4/12/11, Stuart Dallas wrote: On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: eh, I just want to get a shortcut like $id = isset($_GET['id']) ? $_GET['id'] : 0; BTW, I'm using PHP5.3+, thanks bros. http://stut.net/2011/04/12/php-snippet-array-element-access/ -Stu

Re: [PHP] a shortcut to set variable

2011-04-12 Thread Stuart Dallas
On Tuesday, 12 April 2011 at 10:36, Joe Francis wrote: eh, I just want to get a shortcut like > > $id = isset($_GET['id']) ? $_GET['id'] : 0; > > > BTW, I'm using PHP5.3+, thanks bros. http://stut.net/2011/04/12/php-snippet-array-element-access/ -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.

Re: [PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Richard Quadling
2011/4/12 Eli Orr : > Dear PHP Gurus, > > I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB: > > The PHP server adds  utf-8 BOM (UTF-8 Byte Order Mark  - in the beginning of > UTF-8  files) which > consists of three bytes: EF BB BF. > > The Mobile App served by the server Does

[PHP] Re: a shortcut to set variable

2011-04-12 Thread David Robley
Joe Francis wrote: > eh, I just want to get a shortcut like > > $id = isset($_GET['id']) ? $_GET['id'] : 0; > > > BTW, I'm using PHP5.3+, thanks bros. > That should work - what is not happening that you expect to happen, or the other way round? Cheers -- David Robley The best way to keep

[PHP] a shortcut to set variable

2011-04-12 Thread Joe Francis
eh, I just want to get a shortcut like $id = isset($_GET['id']) ? $_GET['id'] : 0; BTW, I'm using PHP5.3+, thanks bros. -- Powered By Francis™. Welcome to my website: http://www.francistm.com Rewrite to francis...@gmail.com please.

Re: [PHP] Error in variable assignment

2011-04-12 Thread Richard Quadling
On 11 April 2011 20:28, Ethan Rosenberg wrote: > Dear list - > > I an writing a script that will simulate a chess board.  On a move from e2 > to e6 [see below] the variable in e2 is never assigned to e6.  Here are some > code snippets: > > session_start(); > session_name("Chess"); > error_reporti

[PHP] Eliminatimg PHP UTF-8 BOM in a returned stream to a Mobile App

2011-04-12 Thread Eli Orr
Dear PHP Gurus, I would like to Eliminate the 3 UTF-8 BOM enforced on my returned BLOB: The PHP server adds utf-8 BOM (UTF-8 Byte Order Mark - in the beginning of UTF-8 files) which consists of three bytes: EF BB BF. The Mobile App served by the server Does not need that. How can I elimi