下面是发送邮件的一段代码,发送没有问题。可是发送完之后显示
***********************
404 NOT FOUND
Sorry, but you are looking for something that isn't here.Search Our Site:
Search for:    10 Most Recent Posts
Search by Month:
Search by Category:
No categories
***********************
如何我才能让他发送完返回到首页
谢了先
***********************
<?php
if (isset($_REQUEST['email']))
{
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
mail( "[email protected]", "Subject: $name", $message, "From:$email" );
echo "Thank you for mailing us";  }
else
{
echo "<form method='post' action='send.php'>
Name: <input name ='name' type='text' /><br />
Email : <input name='email' type='text' /><br />Message:<br />
<textarea name='message' rows='10' cols='30'>
</textarea><br />
<input type='submit' /> </form>";  
}
?>

解决方案 »

  1.   


    <?php
    if (isset($_REQUEST['email']))
    {
    $name = $_REQUEST['name'];
    $email = $_REQUEST['email'];
    $subject = $_REQUEST['subject'];
    $message = $_REQUEST['message'];
    mail( "[email protected]", "Subject: $name", $message, "From:$email" );
    echo "Thank you for mailing us"; 
    header("Location: http://首页网址"); 
    }
    else
    {
    echo "<form method='post' action='send.php'>
    Name: <input name ='name' type='text' /><br />
    Email : <input name='email' type='text' /><br />Message:<br />
    <textarea name='message' rows='10' cols='30'>
    </textarea><br />
    <input type='submit' /> </form>";   
    }
    ?> 
      

  2.   

    谢了,楼上的。不过我试了,还是不行啊,是不是因为我用的是wordpress的原因
    Warning: Cannot modify header information - headers already sent by (output started at /home/kane1994/public_html/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:221) in /home/kane1994/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 10
      

  3.   


    echo "Thank you for mailing us";  
    header("Location: http://首页网址"); deader前面是不能有任何的输出的
      

  4.   

    请在文件的最前端加上ob_start()才可以在header有输出动作,或者用
    echo '<script>location.href = "首页地址";</script>';
      

  5.   

    我是在sidebar里边加的这段code,不是一个完整的文件。
    试了楼上的方法,还是不行。没有什么简单的语句,让它提交完之后就跳转到首页上?
    www.healthmanukahoney.com是我的网站,右边sidebar里边就是我加的代码。提交没问题,就是提交之后报错。
    有兴趣的兄弟姐妹可以看一下,帮忙改改。
      

  6.   

    将echo "Thank you for mailing us";换成header('location:http://www.baidu.com');或者echo '<script>location.href = "http://www.baidu.com";</script>';不行么?
      

  7.   

    呵呵,谢了,十分感谢楼上的,用header不行。用echo可以。没问题了。
    结贴了。