douchuo9476 2017-01-24 22:49
浏览 49

如何在使用PHP发送电子邮件后使div可见

I have the following contact form in my index.html file

<div class="alert alert-success visible" id="successmsg"><strong>Success!</strong> Your message has been sent to us.</div>

 <form method="post" action="mail.php" class="contact-form">
          <div class="form-group">               
            <input type="text" class="form-control"  name="name" id="name" placeholder="Name">
          </div>
          <div class="form-group">                
            <input type="email" class="form-control" name="email" id="email" placeholder="Email">
          </div>
          <div class="form-group">               
            <input type="text" class="form-control"  name="subject" id="subject" placeholder="Subject">
          </div>              
          <div class="form-group">
            <textarea class="form-control" type="text" name="message" id="message" placeholder="Message"></textarea>
          </div>
          <div class="actions">
          <button type="submit" data-text="SUBMIT" class="button button-default"><span>SUBMIT</span></button>
          </div>
        </form>     

The id "successmsg" is hidden in the HTML file using a simple display:none; code & I need to make it visible when the email is sent using the following php

<?php$name = $_POST['name'];

$email = $_POST['email'];

$message = $_POST['message'];

$subject = $_POST['subject'];

$formcontent=" Name: $name 

 Email: $email 

 Subject: $subject 

 Message: $message ";

$recipient = "towersdvd@gmail.com";

$subject = "Website Contact";

$mailheader = "From: $email 
";

mail($recipient, $subject, $formcontent, $mailheader);


<style type="text/css">#lol{display:yes;}</style>
exit;}?>

This doesn't work at all. Can someone assist me with this? Really appreciate your kind help. Thanks in advance! :)

  • 写回答

2条回答 默认 最新

  • dongwu9647 2017-01-24 22:55
    关注

    There isn't any 'yes' value for the display property. Try changing it to {display: block;} or {display: inline;} depending.

    Check this link for more info: https://developer.mozilla.org/en-US/docs/Web/CSS/display

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100