Hi, i am new to coding, and i have a bit of a problem with the contact form on my website.
i have designed and coded my site by my self with tutorials and basic html and css i have learned.
my site is is
here
the code for the contact page is:
i would really appreciate if you could help with this problem.
thanks in advance.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link href='http://fonts.googleapis.com/css?family=Exo:400,200' rel='stylesheet' type='text/css'>
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="js/animated-menu.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
// SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() },
$("#form1").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "ajaxSubmit.php",
ajaxSubmitMessage: "Thank you, We will contact you soon !",
success : false,
failure : function() {}
})
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Con's Folio | Get in touch</title>
<style type="text/css">
<!--
body {
background-color: white;
}
-->
</style></head>
<body>
<div id="index-container">
<div id="banner"></div>
<div id="menu">
<ul>
<li class="green">
<p><a href="index.html">Home</a></p>
<p class="subtext">The front page</p>
</li>
<li class="yellow">
<p><a href="about.html">Blog</a></p>
<p class="subtext">More info</p>
</li>
<li class="red">
<p><a href="folio.html">Folio</a></p>
<p class="subtext">Examples of work</p>
</li>
<li class="blue">
<p><a href="contact.html">Contact</a></p>
<p class="subtext">Get in touch</p>
</li>
</ul>
</div>
<div id="filler-contact"></div>
<div id="contact-form">
<form>
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] text-input" id="name" value="" />
<label for="name">Name</label>
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] text-input" id="email" value="" />
<label for="email">E-mail</label>
</p>
<p class="web">
<input type="text" name="web" id="web" />
<label for="web">Website</label>
</p>
<p class="text">
<textarea name="text" class="validate[required,length[3,300]] text-input" id="text"></textarea>
</p>
<p class="text">
<input type="submit" id="Send" value="Send"/>
</p>
</form>
</body>
</html>
this is the php code i have to send the email.
PHP Code:
<?php
$name = $_POST['name']; // contain name of person
$email = $_POST['email']; // Email address of sender
$web = $_POST['web']; // Your website URL
$comment = $_POST['text']; // Your message
$receiver = "myemail@gmail.com" ; // hardcorde your email address here - This is the email address that all your feedbacks will be sent to
if (!empty($name) & !empty($email) && !empty($comment)) {
$body = "Name:{$name}\n\nWebsite :{$web}\n\nComments:{$comment}";
$send = mail($receiver, 'Contact Form Submission', $comment, "From: {$email}");
if ($send) {
echo 'true'; //if everything is ok,always return true , else ajax submission won't work
}
}
?>