後重定向我是新來這個,我想學習如何編寫代碼。 subimiting登錄,並通過按登錄後,我想重定向到另一個網頁在我的網站(index.php
)。我想使它submiting
這是mail.php
代碼
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$formcontent=" From: $name \n $password \n email: $email \n ";
$recipient = "[email protected]";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader, $password) or die("Error!");
if(isset($_POST['mail'])){
// Fetching variables of the form which travels in URL
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
if($name !=''&& $email !=''&& $password !='')
{
// To redirect form on a particular page
header("Location:http://www.mywebsite.com");
}
else{
?><span><?php echo "Thank You! Your account verification was completed successfully";?></span> <?php
}
}
?>
嗨,你能是在用例更具體一點,因爲使用'頭()'應該做的工作重定向。由於 – Aymeric
所以,如果我只是重定向,你會怎麼認識,我實際上是「登錄」? – Aziz
請將您的代碼降低到必要的最小值。例如。我沒有看到CSS和重定向之間的任何關係。 CSS可以省略。 – Mike