简体   繁体   English

细分和重定向后如何引导模式弹出窗口

[英]How to bootstrap modal popup after submmision and redirect

Hello I Have Contact us Page like this 您好我有联系我们页面

<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> 

My send mail.php like this 我这样发送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');
    }
}
?>

And I am Showing success message on contact us form like this 我在这样的联系我们表格上显示成功消息

<?php
$status=$_GET['status'];
if($status=='success') 
{
?>
<p style="color: green;background-color: #DFF2BF;text-align:center;">
    <?php echo 'Email sent';  ?></p>
<?php } ?>

I wanted to show bootstrap modal popup on Contact Us page 我想在“联系我们”页面上显示引导模式弹出窗口

please help me in that Thanks in advance 请帮助我,在此先感谢

You want to use bootstrap modal on your page but you are writing normal html structure for it. 您想在页面上使用引导模式,但是正在为其编写普通的html结构。

If you want model then you have to write the bootstrap modal structure. 如果需要模型,则必须编写引导程序模态结构。

Please check this link. 请检查此链接。

http://getbootstrap.com/javascript/#modals http://getbootstrap.com/javascript/#modals

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM