I have build my site on my computer localhost, and now i have uploaded the site to www.itaobao.net
But it can not get connected to the mysql DB, of course I have set the username, password and DB name the same as the one in my code.
but still cant get connected to the DB, if you try to login, the site will be redirected to the validate.php and nothing will be happened then, no connection to the DB no error, no nothing just a white page, but it works perfectly locally
please help, whats wrong with my code?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=utf-8"></meta>
<title>Validate</title>
<base target="-blank"></base>
<link rel="stylesheet" type="text/css" href="FirstSite.css">
<link rel="icon" href="Logo.png"></link>
</head>
<body>
<div class="main_container">
<div class="container">
<p class="valid_one">
</p>
<p>
</p>
<p class="valid_two">
<?php
$username = "XXXX";
echo $username;
$password = "XXXXX";
$database = "XXXXXX";
$link = mysql_connect("localhost", "$username", "$password");
echo $link;
if(!$link) {echo("Failed to establish connection to mysql server");
exit();}
$status = mysql_select_db($database);
$uname = mysql_real_escape_string($_POST['email']);
$pword = mysql_real_escape_string($_POST['password']);
$sql= "Select email,password,first_name,user_id,persent FROM personal_info where email='$uname' and password='$pword'";
echo $sql;
$result = mysql_query($sql);
if (isset($result)){
$persentage=mysql_result($result,0,"persent");
$user_email=mysql_result($result,0,"email");
$user_password=mysql_result($result,0,"password");
$user_firstname=mysql_result($result,0,"first_name");
$userrandid=mysql_result($result,0,"user_id");
setcookie("uId","$userrandid");
setcookie("uEmail","$user_email");
setcookie("uPassword","$user_password");
setcookie("uFirstname","$user_firstname");
setcookie("perschk","$persentage");
header( 'Location:ibuytaobao.com/ru/index.php' ) ;
} else {
echo "User not found, Please try again";
setcookie("eMassage","$error_message");
header( 'Location:ibuytaobao.com/ru/index.php' ) ;
}
?>
I have changed the header location to what you see, but still....
please help

New Topic/Question
Reply


MultiQuote







|