http://nhforhealthcarepurplepoints.org
and login... nothing happens... here are the codes... any help?
Code: Select all
<h3>Please Login!</h3>
<FORM ACTION="process_login.php" METHOD="post" name="loginform">
<DIV ALIGN="justify"><?php if(isset($error)){print('<font color="red"><center>'.$error.'</center></font><br>');} ?>
<center><TABLE WIDTH="70%" BORDER="0" CELLPADDING="4" CELLSPACING="0" align="center">
<TR>
<TD WIDTH="28%">Username</TD>
<TD WIDTH="72%"><INPUT name="username" id="username" value="<?php if(isset($remember)){print($remember);} ?>"></TD>
</TR>
<TR>
<TD>Password</TD>
<TD><input name="password" type="password" id="password" /></TD>
</TR>
<TR>
<TD><label>
<input name="remember" type="checkbox" id="remember" value="checked" <?php if(isset($remember)){print("checked=\"checked\"");} else { print(""); } ?> />
<small><b> Remember Me</label></small></b></TD>
<td>
<p>
<input name="destination" type="hidden" value="<?php if(isset($destination)){print($destination);} ?>" />
</p>
<INPUT TYPE="submit" name="Submit" VALUE="Login"></td>
</TR>
</TABLE>
</center>
</DIV>
</FORM>process_login.php
Code: Select all
<?php
require_once("/home/nhforhealthcare/public_html/main.php");
if(isset($_POST['remember'])){
if($_POST['remember']!="checked"){
setcookie('RememberMe', '', time() - 3600);
unset($_COOKIE['RememberMe']);
} else {
$inTwoMonths = 60 * 60 * 24 * 60 + time();
setcookie('RememberMe', $_POST['username'], $inTwoMonths);
}
}
if(isset($_POST['destination'])){
$destination = $_POST['destination'];
}
if(isset($_POST['username'])){
if(!isset($_POST['password'])){
print('That username/password combination is invalid. Either click here to log in as a different user or sign up and get an account at our signup page.');
include 'index.php';
exit;
} elseif(empty($_POST['password']) || ""==$_POST['password']){
print('That username/password combination is invalid. Either click here to log in as a different user or sign up and get an account at our signup page.');
include 'index.php';
exit;
}
$username = $_POST['username'];
// Get Passwords (Submitted and In database)
$get_pass = mysql_query("SELECT * FROM userbase WHERE username = '{$username}' ");
if(!$get_pass){
print("Error in database connection.");
}
$get_pass = mysql_fetch_array($get_pass);
$database_pass = $get_pass['password'];
$pass = $_POST['password'];
//If password is not vaild display error message
if($pass != $database_pass){
print('That username/password combination is invalid. Either click here to log in as a different user or sign up and get an account at our signup page.');
include 'index.php';
exit;
} elseif($pass == $database_pass) {
//Sign-in
$date = date('m d, Y');
$time = time();
$_SESSION['username'] = $username;
$_SESSION['password'] = $_POST['password'];
$_SESSION['login_time'] = $time;
$_SESSION['login_date'] = $date;
$_SESSION['loggedin'] = 1;
// Send to locaton
if(!$destination){
header("Location: usermenu.php");
echo "<meta http-equiv=\"refresh\" content=\"0;url=usercp.php\">";
} else {
$destination = base64_decode($destination);
header("Location: $destination");
echo "<meta http-equiv=\"refresh\" content=\"0;url=$destination\">";
}
}
} else {
// Otherwise just show login.php
include 'index.php';
header("Location: login");
}
ob_flush();
?>