I would appreciate ANY help in this.
This is the authorize.php file.
Code: Select all
<?php
include('include/db.php');
// username and password sent from form
$username=$_POST['username'];
$password=$_POST['password'];
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$sql="SELECT * FROM `client_login` WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
// If result matched $username and $password, table row must be 1 row
if($count==1){
// Register $username, $password and redirect to file "welcome.php"
# set cookie parms - AUTH
$authValue = 1;
setcookie("AUTH", $authValue);
# set cookie parms - USER
$userValue = $result['username'];
setcookie("USER", $userValue);
# set cookie parms - USER
$first_name_sess = $result['first_name'];
setcookie("FIRST_NAME_SESS", $first_name_sess);
# set cookie parms - USER
$last_name_sess = $result['last_name'];
setcookie("LAST_NAME_SESS", $last_name_sess);
# set cookie parms - EID
$eData = $result['EID'];
setcookie("EID", $eData);
header("location:welcome.php");
}
else {
//If wrong username, redirect to login.php after 5 seconds.
echo 'Wrong Username or Password<br />
<form name="redirect">
You will be redirected to the homepage in
<input style="border:0px; width:13px; text-align:right;" type="text" name="redirect2" />
seconds
</form>
<script>
var targetURL="http://www.premiumwebfusion.com/support_system/login.php"
//change the second to start counting down from
var countdownfrom=5
var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}
countredirect()
//-->
</script>';
}
?>
Code: Select all
<?php
$eid = $_COOKIE['EID'];
$fn = $_COOKIE['FIRST_NAME_SESS'];
$ln = $_COOKIE['LAST_NAME_SESS'];
$user = $_COOKIE['USER'];
$authorize = $_COOKIE['AUTH'];
echo $eid;
echo $fn;
echo $ln;
echo $user;
echo $authorize;
?>