Hi, everyone,
Is there anyone who can tell me why
$email = addslashes($_POST['email']);
$password = md5($_POST['password']);
session_start();
$_SESSION['email'] = $email;
$_SESSION['password'] = $password
is not the same as
session_start();
$_SESSION['email'] = addslashes($_POST['email'];
$_SESSION['password'] = md5($_POST['password'];
on some server configurations? On my local server, the first block of code works fine, but on my host's server, the email and password session variables are not set, because $email and $password are empty, but the second block of code works on my host's server.
Any ideas? Thanks!
EDIT
This is interesting... on my host's server, this code:
$myvar = 'hello world';
session_start();
$_SESSION['var'] = $myvar;
//echo '<pre>' . print_r($_SESSION) . '</pre>';
echo '<br />the variable var is set to ' . $var;
outputs:
the variable var is set to hello world
So... what the heck? Is there some PHP configuration setting that automatically equates session variable names with local variable names?