Hey folks, problem here. I basicaly have no idea about coding of any sort, I'm using free code here.
Please help me
Thanks
...........The form
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Contact Us</title>
<script src="lite_validation.js"></script>
<script>
required.add('Full_Name','NOT_EMPTY','Full Name');
required.add('Email_Address','EMAIL','Email Address');
required.add('Your_Message','NOT_EMPTY','Your Message')
</script>
<link rel="stylesheet" type="text/css" href="lite_styles.css">
</head>
<body>
<form name="contactformlite" method="post" action="lite_process.php" onsubmit="return validate.check(this)">
<table width="400px" class="cflite">
<tr>
<td colspan="2">
<p style="text-align:center">Fields marked with <span class="required_star"> * </span> are required.</p>
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Full_Name" class="required">Full Name<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<input type="text" name="Full_Name" id="Full_Name" maxlength="80" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Email_Address" class="required">Email Address<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<input type="text" name="Email_Address" id="Email_Address" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Telephone_Number" class="not-required">Telephone Number</label>
</td>
<td valign="top" class="cflite_td">
<input type="text" name="Telephone_Number" id="Telephone_Number" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Your_Message" class="required">Your Message<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<textarea style="width:250px;height:120px" name="Your_Message" id="Your_Message" maxlength="2000"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center" class="cflite_td">
<input type="submit" value="Submit">
<br /><br />
</td>
</tr>
</table>
</form>
</body>
</html>
The php.........................
<?php
// URL: [url]www.freecontactform.com[/url]
// Version: FreeContactForm Lite V1.0
// Copyright (c) 2009 Stuart Cochrane <stuartc1@gmail.com>
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
if(isset($_POST['Email_Address'])) {
include 'lite_settings.php';
if($email_to == "BThomsontestacc@aol.com") {
die("This message is for the Webmaster. Please enter your email address into the file 'lite_settings.php'");
}
function died($error) {
echo "Sorry, but there were error(s) found with the form your submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
if(!isset($_POST['Full_Name']) ||
!isset($_POST['Email_Address']) ||
!isset($_POST['Telephone_Number']) ||
!isset($_POST['Your_Message'])) {
died('We are sorry, but there appears to be a problem with the form your submitted.');
}
$full_name = $_POST['Full_Name']; // required
$email_from = $_POST['Email_Address']; // required
$telephone = $_POST['Telephone_Number']; // not required
$comments = $_POST['Your_Message']; // required
$error_message = "";
$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
if(!eregi($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($full_name) < 2) {
$error_message .= 'Your Name does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\r\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Full Name: ".clean_string($full_name)."\r\n";
$email_message .= "Email: ".clean_string($email_from)."\r\n";
$email_message .= "Telephone: ".clean_string($telephone)."\r\n";
$email_message .= "Message: ".clean_string($comments)."\r\n";
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
header("Location: $thankyou");
?>
<script>location.replace('<?php echo $thankyou;?>')</script>
<?
}
?>
Thanks again