Hi all,
I am going bald on this one. ![]()
I wonder what could be wrong. I could login to my local server but cant login in a live server!
thanks all
<?php
if(isset($_POST['login'])){
$tbl_name="reg_users";
// Define $myusername and $mypassword
$username=$_POST['username'];
$password=$_POST['password'];
// To protect MySQL injection
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
if($username == ''){
echo "<font color='red' size='-2'><b>Pls Enter User ID</b></font>";
}
if($password == ''){
echo "<font color='red' size='-2'><b>Pls Enter Password</b></font>";
}else{
$crypt_pass = md5($password);
//check for existance of username and password
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$crypt_pass'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register username and password and redirect to login page"
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
header("location: ../folder/filename.php");
exit();
}
else {
//if no match found, echo out error message
echo "<font color='red' size='2'><b>Invalid User ID or Password</b></font><br>";
} }
}
ob_end_flush();
?>




Find content
Male
