Hello, I have a contact form here... http://livingfortodayband.co.uk/basement2/contact.php
This is just a simple form with no validation or spam protection. It just works. I have chosen to start simple and work up as I am no expert in php, I don't know a lot to be fair...
My next step is validation of the form fields but honestly I don't know where to start. I have followed a few tutorials and they have not worked so I was wondering if there is someone who would be willing to assist me in working this code out.
The style I am going for is like this... http://junglejap.com/FormTest/
I have found this page but I am not sure how to implement the code into my page... http://bassistance.de/jquery-plugins...in-validation/
I have been told the styles above are done or can be done via javascript so i thought i'd request some specialist help as I have no idea in this field unfortunately.
This is the php code above everything in the contact.php page:
PHP Code:
<?php
/* Subject and Email Variables */
$emailSubject = 'Basement Studio Web Enquiry';
$webMaster = 'lukecottingham@hotmail.co.uk';
/* Gathering Data Variables */
$name = $_POST['name'];
$email = $_POST['email'];
$artist = $_POST['artist'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$body = <<<EOD
<br><hr><br>
Name: $name<br>
Email: $email<br>
Artist: $artist<br>
Subject: $subject<br>
Message: $message<br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$seccess = mail($webMaster, $emailSubject, $body, $headers);
?>
Below is the form on the website:
HTML Code:
<form method="post" action="contact.php" id="contactform">
<ol>
<li>
<label for="name">First Name <span class="required">*</span></label>
<input id="name" name="name" class="text">
</li>
<li>
<label for="email">Your email <span class="required">*</span></label>
<input id="email" name="email" class="text" />
</li>
<li>
<label for="artist">Band/Artist Name</label>
<input id="artist" name="artist" class="text">
</li>
<li>
<label for="subject">Subject<span class="required">*</span></label>
<input id="subject" name="subject" class="text">
</li>
<li>
<label for="message">Message <span class="required">*</span></label>
<textarea id="message" name="message" class="text" rows="6" cols="50"></textarea>
</li>
<li class="buttons">
<input name="imageField" id="imageField" src="images/send.jpg" class="send" type="image">
<div class="clr"></div>
</li>
</ol>
</form>
I will be so grateful if someone can help me out in this...
Thanks!
Bookmarks