I’m learning PHP to enable my contact form to work. It seems like I am almost there - when the user clicks submit it generates an email to my account, but it doesn’t give the user the “Thank you your email was sent” or refresh the form. Both pages below are located in root folder of server site. If anyone can take a look I would appreciate any comments.
Here’s the code on my contact.html page:
<script src="js/jquery-1.4.2.min.js"></script> <!-- jquery library -->
<script src="js/jquery.prettyPhoto.js"></script> <!-- lightbox plugin -->
<script src="js/jquery.nivo.slider.pack.js"></script> <!-- nivo slider plugin -->
<script src="js/cufon-yui.js"></script><!-- cufon library -->
<script src="js/tweets.js"></script><!-- twitter plugin -->
<script src="js/Vegur_300-Vegur_700.font.js"></script><!-- vegur font -->
<script src="js/jquery.form.js"></script> <!-- jQuery form plugin-->
<script src="js/custom.js"></script><!-- custom jquery stuff-->
<link rel="stylesheet" href="style.css" type="text/css" media="screen" /><!-- general stylesheet -->
<link rel="stylesheet" href="custom.css" type="text/css" media="screen" /><!-- custom stylesheet -->
<!-- version number: 1.0.0 -->
Contact
Your email is sent! Thanks!
Your email could not be sent. Please fill in the data correctly.
Your email failed due to server error. Try again later.
<ol class="forms">
<li><label for="contactName">Name:</label>
<input type="text" name="contactName" id="contactName" value="" class="requiredField" />
</li>
<li><label for="email">Email:</label>
<input type="text" name="email" id="email" value="" class="requiredField email" />
</li>
<li class="textarea"><label for="commentsText">Message:</label>
<textarea name="comments" id="commentsText" rows="20" cols="18" class="requiredField"></textarea>
</li>
<li class="screenReader"><label for="checking" class="screenReader">If you want to submit this form, do not enter anything in this field</label><input type="text" name="checking" id="checking" class="screenReader" value="" /></li>
<li class="buttons"><input type="hidden" name="submitted" id="submitted" value="true" /><input class="submit" type="submit" value="Submit" /></li>
</ol>
</form>
Here’s the code on my contact_send.php page: