Hello,
I am new to PHP and am having problems with users being able to log in. I have tested the following code on my machine at home and it works perfectly, however when I try to log in on the clients' server it sends me back to the login page. Any help is greatly appreciated. Thanks.
<?php require_once('../Connections/myConn.php'); ?>
<?php
$username=$POST["username"];
$password=md5($POST["password"]);
mysql_select_db($database_myConn, $myConn);
$query_rsLogin = "SELECT username,password FROM members WHERE username='$username' and password='$password'";
$rsLogin = mysql_query($query_rsLogin, $myConn) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);
if ($totalRows_rsLogin >= 1) {
session_start();
$HTTP_SESSION_VARS['auth'] = $username;
header("Location: reservations.php");
exit;
}
else
{
header("Location: login.php");
exit;
}
mysql_free_result($rsLogin);
?>
Cassandra
P.S.- I am using PHP 4.3.0 the other server is using PHP 4.3.1