Forum Moderators: coopster
thanks so much. Actually I now don't have a choice. I am facing a terrible problem which I posted here
[webmasterworld.com...]
Why would my php script that has run fine for so long (2 years) suddenly crash the server as claimed by my web host? Can't be the increase in traffic. I've been hovering on page #1 (google and yahoo!) for months.
Good luck! :)
They'll need to unsuspend you for you to experiment, but if you can stick this at the top of a script:
foreach($_GET as $vbl => $val)
$$vbl = $val;
foreach($_POST as $vbl => $val)
$$vbl = $val;
and see if the script straightens up. If so, then you should remove those lines and go through each script and straighten it out: explicitly grab the variable you're wanting and validate it before use.
then echo $vbl{2}; produces
w
and echo $vbl[2]; produces
w
I just checked it and in both php4 and php5, you can do:
$vbl = array("Howdy","hello","goodbye");
and both forms will produce
goodbye
which is not what I expected. But there were no errors. I don't know what to tell you - I'm at a loss. I can't think of any reason that a php4 script would bring down a server when it's run under php5. It would certainly seem reasonable that they could at least say 'well here's what it says in our error logs' to help you pinpoint the problem.
I changed the {curly} back to [square] and no problems...
Then I tested a file without the register globals... and it hung. So I went through every file and made sure they complied with the register globals requirement. All seems okay now...
Fingers and toes crossed!