如何在submmision和重定向后引导模态弹出窗口

时间:2017-01-25 05:12:30

标签: php phpmailer

您好我已经联系过我们这样的页面

<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模式弹出

请提前致谢我帮助我

1 个答案:

答案 0 :(得分:0)

您想在页面上使用bootstrap模式,但是您正在为它编写正常的html结构。

如果你想要模型,那么你必须编写bootstrap模态结构。

请查看此链接。

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