dongying3830 2013-08-11 02:08
浏览 19

使用外部php文件表单显示“成功”[关闭]

I have this form in a file called "requestaquote.html".

The form is using another file called "requestquote.php" to do it's thing.

Now, this is simple, client will fill in the fields and once a button is clicked, E-mail will be sent.

I need a way to show "E-mail sent" type of thing. Considering my form is using another file to handle the E-mail, I have to redirect back to original page and display "E-mail sent".

How do I do this?

  • 写回答

1条回答 默认 最新

  • dongshiran7000 2013-08-11 02:09
    关注

    1.You could redirect from php by

    <?php header('location:NEW_PAGE_LOCATION.html'); ?>
    

    as long as your php code does not produce single bit of html code (even a space!)

    2.You can display message from the php script by

    echo 'email sent';
    

    3.You can include another file from the php one by

    include('NEW_PAGE.html');
    

    4.Or you could create the main file, that includes this action file by

    include('requestquote.php');
    if($email_sent) echo'email sent';
    

    There are many possible ways of achieving this

    评论

报告相同问题?