电子邮件验证码未在服务器中运行。但它运行在localhost中

时间:2014-12-24 13:37:06

标签: mysql database localhost server email-validation

这是我的代码。我想验证电子邮件。如果输入email double redirect sorry.php页面。此代码在localhost中有效。但是当我上传到服务器。它不起作用。

<?php include "db.php";

$fblood=$_POST["blood"];
$fname=$_POST["name"];
$femail=$_POST["email"];
$fpassword=$_POST["password"];
$fdistrict=$_POST["district"];
$farea=$_POST["area"];
$fcontact=$_POST["contact"];
$fstatus=$_POST["status"];
$ffacebook=$_POST["facebook"];
$flastdate=$_POST["lastdate"];
$fextra=$_POST["extra"];

$sql = "SELECT count(*) FROM signup WHERE email = '$femail' AND 
password ='$fpassword' LIMIT 1";

$result = mysql_query($sql) or die(mysql_error());

if (mysql_result($result, 0) > 0){


        header('Location: sorry.php');
}

elseif (mysql_result($result, 0) < 1)

    {

    // $query_auto = "INSERT INTO form (date, time) VALUE ('DATE: Auto CURDATE()', CURDATE() )";


mysql_query("INSERT INTO signup(`id`, `blood`, `name`, `email`, `password`, `district`, `area`, `contact`, `status`, `facebook`, `lastdate`, `extra`) 
            VALUES(NULL,'$fblood','$fname','$femail','$fpassword', '$fdistrict', '$farea', '$fcontact', '$fstatus', '$ffacebook', '$flastdate', '$fextra' )") or die(mysql_error());
    header('Location: congratulations.php');
}
?>

1 个答案:

答案 0 :(得分:0)

问题解决了。只是一个空间问题。 elseifelse if