HTML/CSS panel not displaying through JavaScript in PHP -


i trying make so, when user clicks on contact button @ bottom of page, php script check if message sent , show panel based on status. i've implemented css class display panel not working.

sample:

the script can found on adamginther.com

http://jsfiddle.net/gintherthegreat/zfkmt/

<div id="contactme"> <p>whether you’re stopping hi or have inquiry, enjoy receiving messages. of employers out there, searching far , wide summer internship.</p> <br> <a href="https://www.facebook.com/whoisthecoolestpersonalive?ref=tn_tnmn"> <img src="images/facebook-512.png" height="50" width="50" alt="facebook" target="_new"> </a> 

<br> <br> <form action="contact.php" method="post">     <label name="firstname">name:</label>     <input type="text" name="firstname">     <br>     <br>     <label name="email">e-mail address:</label>     <input type="text" name="email">     <br>     <br>     <label name="message">message:</label>     <textarea name="message" id="message"></textarea>     <br>     <br>     <input type="submit" value="say hello!" id="contactbutton"> </form> <div id="panel">         <h1 id="output-inside"></h1>      <br>     <input type="button" alt="close" value="close" id="close-panel"> </div> <?php $field_firstname=$ _post[ 'firstname']; $field_email=$ _post[ 'email']; $field_message=$ _post[ 'message']; $mail_to='gintherthegreat@gmail.com' ; $subject='adamginther.com message ' .$field_firstname; $body_message='from: ' .$field_firstname. "\n"; $body_message .='e-mail: ' .$field_email. "\n"; $body_message .='message: ' .$field_message; $headers='from: ' .$field_email. "\r\n"; $headers .='reply-to: ' .$field_email. "\r\n"; $mail_status=m ail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript">     $('#panel').show();     $('#output-inside').text('thank ' + firstname + ', can.'); </script> <?php } else { ?> <script language="javascript" type="text/javascript">     $('#panel').show();     $('#output-inside').text('i sorry ' + firstname + ', there problem processing request. can contacted e-mail @ gintherthegreat@gmail.com'); </script> <?php } ?> 

try change action page:

<form action="contact.php" method="post"> 

to itself:

<form action="" method="post"> 

because that's did.

however, trying display popup message according mail(); function return. it's better if use ajax.

a tutorial: send email using ajax


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -