Eggie 0 Report post Posted February 20, 2010 I am "rewriting" my old game scripts and i am having problems with it ...right now i am having problems recovering my login form scriptthis is in my head.php <tr><form method=post action=login.php> <td align="center"><b>Name</b></td> </tr> <tr> <td align="center"><input type=text name=user size="12"></td> </tr> <tr> <td align="center"><b>Password</b></td> </tr> <tr> <td align="center"><input type=password name=pass size="12"></td> </tr> <tr> <td align="center"> <p align="center"><input type=submit value=Login></form></p> this is in my login.php<?php $title = "Login"; if (!$user || !$pass) { include("head.php"); print "Please fill out all fields."; include("foot.php"); exit;} it says "Notice: Undefined variable: user in C:\wamp\www\login.php on line 2" when i try to login ...what is the problem??it worked before. Share this post Link to post Share on other sites
iGuest 3 Report post Posted February 21, 2010 Hi Eggie,Newer versions of PHP now have autoglobals off, which means POST'ed data no long take on generating their equivalent named variable.What you now have to do is:$user = $_POST['user'];$pass = $_POST['pass'];Your scripts could do with some better checks though to make sure the data exists, otherwise you're going to throw up warnings if you had error reporting on.Cheers,MC Share this post Link to post Share on other sites
Eggie 0 Report post Posted February 21, 2010 Hi mastercomputers,i can see some things have been changed on php...this doesn't sound good ;)so,i can't just make "autoglobals" on??i have many errors since last time i used my site(which is no longer hosted,i am using wamp to finish it)i will need to make many changes on my site because of this,and i won't if i can do something else ;)Thanks...Eggie Share this post Link to post Share on other sites
FirefoxRocks 0 Report post Posted February 22, 2010 I would recommend leaving register_globals OFF. Having register_globals ON is very dangerous as stated by the PHP team: http://php.net/manual/en/security.globals.php Learn to validate input and develop with register_globals off, cause it is easy to hack into your site if you leave register globals on. Share this post Link to post Share on other sites
magiccode91405241511 0 Report post Posted March 1, 2010 You should leave the register global off and take a lookof this function. It can temp. import global variables ($_POST*, $_GET*, $_COOKIE*) into typical scalar variables similar to register global on.After the script work correctly. You can update all of your scripts to work with register global off. Share this post Link to post Share on other sites
8ennett 0 Report post Posted March 1, 2010 You should probably check your code for deprecated functions as well. A lot of functions were superseded by either improved versions or replaced completely in PHP 5 and will be removed in PHP 6. It's funny though because a lot of web hosts are still using PHP 4 and are refusing to upgrade to 5. Share this post Link to post Share on other sites