提交和重定向后如何 bootstrap 模态弹出
How to bootstrap modal popup after submmision and redirect
您好,我有这样的联系我们页面
<form id="contact_form" action="sendmail.php" method="POST" enctype="multipart/form-data">
<div class="row">
<label for="name">Your name:</label><br />
<input id="name" class="input" name="name" type="text" value="" size="30" /><br />
</div>
<div class="row">
<label for="email">Your email:</label><br />
<input id="email" class="input" name="email" type="text" value="" size="30" /><br />
</div>
<div class="row">
<label for="message">Your message:</label><br />
<textarea id="message" class="input" name="message" rows="7" cols="30"></textarea><br />
</div>
<input id="submit_button" type="submit" value="Send email" />
</form>
我这样发送mail.php
<?php
if(isset($_POST['email'])) {
$subject = "Contact Us Form";
$name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$Enquiry=$_POST['message']; // required
$message = '<html><body>';
$message .= '<img src="http://inncrotech.com/migration/wp-content/uploads/2017/01/LGD4.png" alt="Website Change Request" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($name) . "</td></tr>";
$message .= "<tr style='background: #eee;'><td><strong>Email:</strong> </td><td>" . strip_tags($email_from) . "</td></tr>";
$message .= "<tr style='background: #eee;'><td><strong>Enquiry:</strong> </td><td>" . strip_tags($Enquiry) . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
$to = "somone@edgemigration.com.au";
$header = "From:team@inncrotech.site \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
header('Location: http://abc.website/contact-us?status=success');
}else {
header('Location: http://abc.website/contact-us?status=fail');
}
}
?>
而且我在这样的联系我们表单上显示成功消息
<?php
$status=$_GET['status'];
if($status=='success')
{
?>
<p style="color: green;background-color: #DFF2BF;text-align:center;">
<?php echo 'Email sent'; ?></p>
<?php } ?>
我想在“联系我们”页面
上显示 bootstrap 模式弹出窗口
请帮助我提前谢谢
您想在页面上使用 bootstrap 模态,但您正在为其编写正常的 html 结构。
如果你想要模型,那么你必须编写 bootstrap 模态结构。
请检查此 link。
您好,我有这样的联系我们页面
<form id="contact_form" action="sendmail.php" method="POST" enctype="multipart/form-data">
<div class="row">
<label for="name">Your name:</label><br />
<input id="name" class="input" name="name" type="text" value="" size="30" /><br />
</div>
<div class="row">
<label for="email">Your email:</label><br />
<input id="email" class="input" name="email" type="text" value="" size="30" /><br />
</div>
<div class="row">
<label for="message">Your message:</label><br />
<textarea id="message" class="input" name="message" rows="7" cols="30"></textarea><br />
</div>
<input id="submit_button" type="submit" value="Send email" />
</form>
我这样发送mail.php
<?php
if(isset($_POST['email'])) {
$subject = "Contact Us Form";
$name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$Enquiry=$_POST['message']; // required
$message = '<html><body>';
$message .= '<img src="http://inncrotech.com/migration/wp-content/uploads/2017/01/LGD4.png" alt="Website Change Request" />';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($name) . "</td></tr>";
$message .= "<tr style='background: #eee;'><td><strong>Email:</strong> </td><td>" . strip_tags($email_from) . "</td></tr>";
$message .= "<tr style='background: #eee;'><td><strong>Enquiry:</strong> </td><td>" . strip_tags($Enquiry) . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
$to = "somone@edgemigration.com.au";
$header = "From:team@inncrotech.site \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
header('Location: http://abc.website/contact-us?status=success');
}else {
header('Location: http://abc.website/contact-us?status=fail');
}
}
?>
而且我在这样的联系我们表单上显示成功消息
<?php
$status=$_GET['status'];
if($status=='success')
{
?>
<p style="color: green;background-color: #DFF2BF;text-align:center;">
<?php echo 'Email sent'; ?></p>
<?php } ?>
我想在“联系我们”页面
上显示 bootstrap 模式弹出窗口请帮助我提前谢谢
您想在页面上使用 bootstrap 模态,但您正在为其编写正常的 html 结构。
如果你想要模型,那么你必须编写 bootstrap 模态结构。
请检查此 link。