My query is working absolutely fine on localhost but when i execute this on server the query successfully passed but it redirect myself to login.php and shows login query instead going on welcome.php page
suppose when i enter username/password it redirect myself to login.php with the successful MySQL syntax query.. and query shows on the screen
like my username is v@v.com password v then after pressing login button it redirect me to login.php instead of welcome.php showing query like this query on the screen
SELECT * FROM members WHERE username = 'v@v.com' AND pas = '7a38d8cbd20d9932ba948efaa364bb62651d5ad4'
this is my code "login.php"
<?php
//Start session
session_start();
//Connect to mysql server
include('config.php');
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
$a = clean($_POST['username']);
$password = clean($_POST['password1']);
$passwordx= sha1($password);
//Create query
$qry="SELECT * FROM members WHERE username = '$a' AND pas= '$passwordx'";
$result=mysql_query($qry);
echo $qry;
//Check whether the query was successful or not
if($result) {
if(mysql_num_rows($result) > 0) {
//Login Successful
session_regenerate_id();
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['id'];
$_SESSION['SESS_FIRST_NAME'] = $member['fname'];
$number=$member['number'];
if($number=='1')
{
mysql_query("UPDATE members SET number=number+1 WHERE id='".$_SESSION['SESS_MEMBER_ID'] ."' ") ;
header("location: info.php");
exit();
}
else
{
header("location: welcome.php");
exit();
}
exit();
} elseif(mysql_num_rows($result) == 0){
header("location: error.php");
exit();
}
} else {
header("location: error.php");
exit();
}
?>
can someone spot the mistake?