View Single Post
Old 04-25-2006, 10:29 AM   #2 (permalink)
trache
Insane
 
trache's Avatar
 
Quote:
# See if we should any $spacer in connection to this link.
if ($i>0 AND $i<sizeof($pages)-1)
{
I'm no PHP guru, however I don't recall ever seeing the word "AND" in a PHP if/then/else statement. Change it to '&&'. In fact, I see 'AND' throughout. Change them all.

You could always wrap your conditions in brackets to isolate them from any other tests. That's what I do, anyway. It makes it easier to read and understand what is being tested.

One thing I do to make sure I'm debugging the correct code (sometimes PHP errors are hard to track because of the output you actually get on your page) is just insert "print "boo"" or whatever to track where in the execution pipeline my code is at the moment. PHP is pretty good at telling you what line number it messed up on, but sometimes is the line you don't have to change to debug your program.
__________________
"You looked at me as if I was eating runny eggs in slow motion." - Gord Downie of The Tragically Hip
trache is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62