I've copied the entire code of the file in case its a problem with something else.
The problem i think it is, is with the SQL select statement. But may be wrong.
<?php
require('../config.php');
require('../smarty-config.php');
require('../smarty.php');
session_start();
//print "Username: {$POST['txtUsername']}<br />";
//print "Password: {$POST['Password']}<br />";
$result = mysql_query("Select loginName FROM Admin_Member WHERE loginName='$POST[txtUsername]' AND password=password('$POST[txtPassword]')");
$numrows = mysql_num_rows($result);
$username = $POST['txtUsername'];
$password = $POST['txtPassword'];
// Validation
if(isset($username) && $username != "") {
if(isset($password) && $password != "") {
if ($numrows == 1) {
$SESSION['auth']="yes";
$SESSION['username'] = $username;
//print "Success, Please Wait";
//print "Redirecting....";
$smarty->display('admin_panel/admin_panel_index.tpl');
} else {
print "Unsuccessful login";
}
} else {
print "Please enter a password into the required field</br />";
}
} else {
print "Please enter a username into the required field</br />";
}
mysql_close();
?>
The problem is that when i try to login i keep getting login unsucsessful. It works on my development machine, php5, apache2, etc. But when i upload the entire code and exact database with all the insert statements I keep getting an unsuccessful login. I've had a few problems before when putting code on the host because its an older version of php (version 4.4.2)
Can anyone see why its failing to login using this script?