dongying3830 2013-08-10 18: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-10 18: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

    评论
    编辑
    预览

    报告相同问题?

    手机看
    程序员都在用的中文IT技术交流社区

    程序员都在用的中文IT技术交流社区

    专业的中文 IT 技术社区,与千万技术人共成长

    专业的中文 IT 技术社区,与千万技术人共成长

    关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

    关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

    客服 返回
    顶部