Quote:
Originally Posted by ArizonaJohn
Hmm. I use $find elsewhere as both a session and local variable and it works just perfectly.
It'll probably work fine 99% of the time. It's that 1% I'm worried about.
It's generally just not a good idea to mix up safe and unsafe data, nor to override global variables that your code may rely on further down the line.
And, by the way, relying on the
register_globals directive is a horrible idea.
Even the
PHP manual points that out ;)
In any case, it will be remved in PHP6 so it won't be a problem much longer.
Quote:
Originally Posted by ArizonaJohn
I tried reversing $_SESSION['find'] = $find; to $find = $_SESSION['find']; and it doesn't seem to make a difference.
Yep, seeing as register_globals is on, they are both the same variable.
You can remove the line, it's completely pointless. Kind of like doing
"$find = $find;".
Besides this, I can't see anything in the code you posted that would account for this.
You appear to have removed some code from the
search.php file. Could the problem be in the code you didn't post?