HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Programming/Scripts (http://www.howtoforge.com/forums/forumdisplay.php?f=7)
-   -   Problems after PHP update (http://www.howtoforge.com/forums/showthread.php?t=87)

uli 13th May 2005 16:39

Problems after PHP update
 
I've updated my PHP installation on my server, but now most of my PHP scripts don't work anymore. For example, I have a login form like this:

Code:

<form action="login.php" method="post">
Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br />
<input type="submit" name="submit" value="Login" />
</form>

Now, if I do a
PHP Code:

echo $username

in login.php, it shows nothing... :confused:

Uli

joe 14th May 2005 21:48

It might have done something to your global variables. Try

Code:

echo $_POST[username]
does that work?

falko 17th May 2005 12:35

I think it's because register_globals went from on to off in your new PHP version. This is explained here: http://de3.php.net/manual/en/languag...predefined.php

So you have to change your scripts (e.g. use $_POST['id'] instead of $id) or change register_globals to on in your php.ini (don't forget to restart Apache then).

uli 18th May 2005 21:00

Thanks Joe and Falko! That helped a lot! :) :)

I set register_globals to on now in my php.ini, and my scripts are working again.

Uli

joe 19th May 2005 00:06

Glad it's working :)

I would recommend using $_POST and $_GET rather than just plain $username. Keeps things more secure so an incident doesn't happen involving $password from GET instead of POST.

uli 19th May 2005 15:33

Right, but I'm rather lazy... :D

Uli


All times are GMT +2. The time now is 20:29.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.