我有一个注册页面,在我的本地主机上运行良好。当用户提交表单时,它将获得操作页面并处理注册,并在成功提交后将用户重定向到确认页面。
但是在服务器中,当用户提交表单时,它会转到操作页面并一次又一次地重新加载,但没有任何反应。
我正在使用 php。
如果这个论坛的任何人已经遇到过这种情况或知道为什么会发生这种情况,请帮助我。在将项目上传到服务器后,我今天必须交付项目。
代码:
require_once('conn.php');
$exp1 = $_POST["exp1"]; $exp2 = $_POST["exp2"];
$expdate = $exp1 . "/" . $exp2;
if ($_POST['hwno'] != 'BYOD') {
$shipadd = $_POST["shipadd1"] . " " . $_POST["shipadd2"] . ", " . $_POST["shipadd3"] . " " . $_POST["shipadd4"] . " " . $_POST["shipadd5"];
}
$shipname = $_POST["fname"] . " " . $_POST["lname"];
if($_POST["type"] != "satellite") {
$location = $_POST["dbcountry"] . " - " . $_POST["dbcity"] . ", " . $_POST["dbstate"];
$location2 = $_POST["dbcountry2"] . " - " . $_POST["dbcity2"] . ", " . $_POST["dbstate2"];
$lnum = $_POST["dblocalnum"];
$lnum2 = $_POST["dblocalnum2"];
} else {
$location = "none";
$location2 = "none";
$lnum = "none";
$lnum2 = "none";
}
$sfname = $_POST["fname"];
$slname = $_POST["lname"];
$sstreet = $_POST["street"];
$scity = $_POST["city"];
$sgtotal = $_POST["gtotal"];
if ($_POST['hwno'] != 'BYOD') {
$sshipmethod = $_POST["shipmethod"];
$query = "query here";
}
else {
$query = "query here";
}
$to = "email here";
$subject = "subject";
$message = "message hre";
$confirmationMail = mail ($to, $subject, $message, $from);
if(!$confirmationMail) {
echo "Something went wrong. Please try again";
}
$returnTo = "thankyou.php";
//echo $returnTo;
}
}
else {
echo "error writing to database";
}
?>
<html>
<head>
<script language="JavaScript">
document.location = "<?php echo $returnTo; ?>";
</script></head>
提前致谢