I have a signup page which is working fine on my localhost. When an user submits the form it will got the action page and process the signup and after successful submission it will redirect user to a confirmation page.
But in server when a user submits the form it goes to the action page and just gets reloaded again and again but nothing happens.
I am working with php.
If anyone of this forum already faced this type of scenario or know why this is happening please help me. I have to deliver the project today after uploading the project on server this is happening.
code:
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>
Thanks in advance