Can';t将我的php页面重定向到我的html谢谢页面。我做错了什么?
这是我的html代码和我的表单。此文件名为interest.htmlCan';t将我的php页面重定向到我的html谢谢页面。我做错了什么?,php,html,forms,redirect,Php,Html,Forms,Redirect,这是我的html代码和我的表单。此文件名为interest.html 给我写信 如果您想与我联系,请联系 在返回任何内容之前,必须调用标题指令。但是您在标题之前写echo试试看 <?php ob_start(); //redirect to thank you page //if information is not entered properly send to error page //submit an confirmation email to me $name = $_
给我写信
如果您想与我联系,请联系
在返回任何内容之前,必须调用标题指令。但是您在标题之前写echo
试试看
<?php
ob_start();
//redirect to thank you page
//if information is not entered properly send to error page
//submit an confirmation email to me
$name = $_POST["name"];
$email = $_POST["email"];
$msg = $_POST["msg"];
echo "<pre>";
$email_body = "";
$email_body .= "Name " . $name . "\n";
$email_body .= "Email " . $email . "\n";
$email_body .= "Message " . $msg . "\n";
echo $email_body;
echo "</pre>";
header("location:sent.html");
?>
我是个白痴。感谢您的快速回复,效果非常好。:)在本地主机上工作,但在我的github上不工作。ioit是github页面吗?github不支持php