Hey guys
i am making a sign-up form..
to cut the story short...
Thes signup form sends all the variables via POST to a "register.php" script..
the register.php script sets several session variables based on the user inputs on the first form..
The weird thing is, the whole script works perfectly, untill i have the following lines
$_SESSION['pass1'] = $pass1;
$_SESSION['pass2'] = $pass2;
$_SESSION["nameM"] = $nameM;
$_SESSION["nameP"] = $nameP;
$_SESSION["onsiteS"] = $nameS;
when i have those lines in my script i get a "The page cannot be displayed" error as if my register.php script isnt present..
I did some playing around..after HOURS of trying to figure out wha the heck is wrong, I noticed some patterns..
i noticed that my script works if:
1) I set 3 of the above session variables only and remove 2
eg:
$_SESSION['pass1'] = $pass1;
$_SESSION['pass2'] = $pass2;
$_SESSION["nameM"] = $nameM;
If I include a FOURTH one.. page will not be found..
2) Adding the fourth line gives a page display error:
eg
$_SESSION['pass1'] = $pass1;
$_SESSION['pass2'] = $pass2;
$_SESSION["nameM"] = $nameM;
$_SESSION["nameP"] = $nameP;
BUT IF I SLIGHTLY change the fourth line to something like:
$_SESSION['pass1'] = $pass1;
$_SESSION['pass2'] = $pass2;
$_SESSION["nameM"] = $nameM;
$_SESSION["nameMP"] = $nameP;
the script will work! any SLIGHT modification from
nameM
to
nameMP or name21313 or nam
it will work..
3) I also noticed that enclosing the source variables in quotes can make things work again..
eg
$_SESSION['pass1'] = "$pass1";
$_SESSION['pass2'] = "$pass2";
$_SESSION["nameM"] = "$nameM";
$_SESSION["nameMP"] = "$nameP";
Other things i've noticed..
I tested my script on my online server and there seems to be no problem.. i did notice that the online server has
register_globals = On
while i have mine turned OFF
.. ofcourse it's advisable to keep register_globals OFF.. and well, I DONT SEE WHY the PHP is behaving this way whether global variables are on or off...
any ideas??
Tea