Tom Heston asked:
I just upgraded to the latest version of PHP by switching to a new dedicated server. Several of my websites have login PHP scripts. These no longer work. It appears that the variables are not being passed from the form to the php script.
I just upgraded to the latest version of PHP by switching to a new dedicated server. Several of my websites have login PHP scripts. These no longer work. It appears that the variables are not being passed from the form to the php script.
Is there some simple way to fix this?
was running 4.3.2 now 5.1.4
vBulletin works, but my own scripts have bugs, the major one being an inability to pass variables from a form (html page) to a php script.


5 Comments to 'Just upgraded PHP, and now scripts are not working?'
July 27, 2010
What version were you running on before?
**********
You might be having problems with your request methods. If you are using $HTTP_GET_VARS() instead of $_GET(), that may be your problem (I know I’ve run into this alter clients OSCommerce code from php 4 to php 5. Dave basically summed it up, though Colinc doesn’t seem to have a clue.
July 29, 2010
This could be a global server vars problem as it is disabled by default in later versions of PHP (4.21 onwards)……you need to enable it in the config or change the scripts Try this resource
July 30, 2010
Try adding a session_start() at the top of each page, most servers do not allow auto sessions.
August 2, 2010
A problem that a lot of developers have after changing from PHP4 to PHP5, is like you mentioned with the variables, because of the “register_globals” setting being turned off.
To fix this, you’ll need to back through your scripts, and change the way you handle variables. If you have a variable that is being passed from a form with the form method of “post” you would now declare it like this:
$variableName = $_POST['formFieldName'];
Check out the PHP manual (PHP.net) or one of the many PHP resource sites online for more information.
Alternatively, you could change your register_globals back to “off”, but this is not reccomended, as it opens up your scripts to major security issues.
August 4, 2010
I’ve run into this myself and the problem is that as of PHP 4.2.0, register_globals is disabled by default.
You can still enable globals in your php.ini file, but using globals is a dangerous practice — they are easily poisoned / forged. See first link below.