Hello all,
I have a script that was written on PHP 4, it uses Globals On. Now that I have moved to PHP 5 my script no longer works.
I know that in PHP 4 Globals was on. In PHP 5 Globals is Off by default.
I could override using a php.ini file in the directory, but this is a hack and does not fix the problem.
I know what the problem is, but can't for the life of me figure out how to correct it for PHP 5 and Globals Off. The script has a password field and then if correct logs in the user. If not the error is given.
So... I know I need to update the syntacs but I have no idea what to do here. If I can get some help on thi spart, I can then correct the rest of the script.
The variable $adpasswd is set and pulled from the config.php file. A form is used to login and checks against the config.php to see if the password is correct. If it is you login, if not the error is shown.
Thank you ahead of time for your help.
Here is the part in question:
session_start();
include("templates/header.tpl");
include("config.php");
if(!isset($adminuser)){
if(!isset($action)){
include("templates/login.tpl");
}else{
if($adminpass != $adpasswd){
include("templates/login.tpl");
echo "<table width='100%' border='0' cellspacing='3' cellpadding='3'><tr><td class='message_error' align='center'>Invalid Password, Please Try Again!</td></tr></table>";
}else{
$adminuser = "yes";
session_register('adminuser');
$action = "loggedin";
}
}
}
if(isset($adminuser)){
dbconnect();
include('templates/menu.tpl');
if($action == "loggedin"){
$message = "<tr><td><table width='100%' border='0' cellspacing='3' cellpadding='3'><tr><td class='message_error' align='center'>Hello $contact_name! Nice to see you again. Use the menu above to navigate EzBan.</td></tr></table>";
$msg = $message;
echo $msg;
}See the section on Variables from outside PHP (<!-- m --><a class="postlink" href="http://www.php.net/manual/en/language.variables.external.php">http://www.php.net/manual/en/language.v ... ternal.php</a><!-- m -->). Submitted values are now (and have been since I think 2001) to be found in the $_GET and $_POST arrays.
I have a script that was written on PHP 4, it uses Globals On. Now that I have moved to PHP 5 my script no longer works.
I know that in PHP 4 Globals was on. In PHP 5 Globals is Off by default.
I could override using a php.ini file in the directory, but this is a hack and does not fix the problem.
I know what the problem is, but can't for the life of me figure out how to correct it for PHP 5 and Globals Off. The script has a password field and then if correct logs in the user. If not the error is given.
So... I know I need to update the syntacs but I have no idea what to do here. If I can get some help on thi spart, I can then correct the rest of the script.
The variable $adpasswd is set and pulled from the config.php file. A form is used to login and checks against the config.php to see if the password is correct. If it is you login, if not the error is shown.
Thank you ahead of time for your help.
Here is the part in question:
session_start();
include("templates/header.tpl");
include("config.php");
if(!isset($adminuser)){
if(!isset($action)){
include("templates/login.tpl");
}else{
if($adminpass != $adpasswd){
include("templates/login.tpl");
echo "<table width='100%' border='0' cellspacing='3' cellpadding='3'><tr><td class='message_error' align='center'>Invalid Password, Please Try Again!</td></tr></table>";
}else{
$adminuser = "yes";
session_register('adminuser');
$action = "loggedin";
}
}
}
if(isset($adminuser)){
dbconnect();
include('templates/menu.tpl');
if($action == "loggedin"){
$message = "<tr><td><table width='100%' border='0' cellspacing='3' cellpadding='3'><tr><td class='message_error' align='center'>Hello $contact_name! Nice to see you again. Use the menu above to navigate EzBan.</td></tr></table>";
$msg = $message;
echo $msg;
}See the section on Variables from outside PHP (<!-- m --><a class="postlink" href="http://www.php.net/manual/en/language.variables.external.php">http://www.php.net/manual/en/language.v ... ternal.php</a><!-- m -->). Submitted values are now (and have been since I think 2001) to be found in the $_GET and $_POST arrays.