【发布时间】:2019-06-18 19:36:52
【问题描述】:
我的问题如下:
我有两个文件。我们称它们为 form.html 和 handler.php
如您所料,html 文件是一个电子邮件表单,而 php 文件用于发送它。
现在我想在邮件发送成功与否时从 php 文件中触发 html 文件上的 BS4 警报。
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<strong>Whoops!</strong>Something went wrong there.. Please try again!
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong>Success!</strong>Mail successfully delivered. I will be in touch with you shortly!
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
稍后应该触发警报的 php 代码部分正在链接到定义的页面。
if($mail_senden){
header("Location: ".$url_ok); //Fehler beim Senden
exit();
} else{
header("Location: ".$url_fehler); //Fehler beim Senden
exit();
}
有什么想法吗?
也许我应该提到我熟悉引导程序,但我在 js 和 php 方面的知识非常有限(#scriptkidlifestyle)
【问题讨论】:
-
您可以将 JS 代码注入您正在服务的页面中,那么您的问题是什么?
-
我该怎么做呢?正如我所写,我对 JS 完全一无所知
-
好的,谢谢!我去看看。
标签: javascript php html function call