Tell a friend about the LAJingles.com Blog array( "regex" => "/^([a-zA-Z '-]+)$/", "error" => "Your name appears to be in improper format", ), "email" => array( "regex" => "/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/", "error" => "email address is invalid", ), "message" => array( "regex" => "/.*/", "error" => "Your message is either too short or exceeds $msg_max_chars characters", ), ); global $errors; if(!preg_match($form_items["name"]["regex"], $_POST["your_name"])) $errors[] = $form_items["name"]["error"]; if(!preg_match($form_items["email"]["regex"], $_POST["your_email"])) $errors[] = "your ".$form_items["email"]["error"]; if(!preg_match($form_items["email"]["regex"], $_POST["friend_email1"])) $errors[] = "Friend 1 ".$form_items["email"]["error"]; if(strlen(trim($_POST["message"])) < $msg_min_chars || strlen(trim($_POST["message"])) > $msg_max_chars ) $errors[] = $form_items["message"]["error"]; if(trim($_POST["friend_email2"]) != "") { if(!preg_match($form_items["email"]["regex"], $_POST["friend_email2"])) $errors[] = "Friend 2 ".$form_items["email"]["error"]; } if(trim($_POST["friend_email3"]) != "") { if(!preg_match($form_items["email"]["regex"], $_POST["friend_email3"])) $errors[] = "Friend 3 ".$form_items["email"]["error"]; } return count($errors); } function email($from, $from_name, $to, $message) { //header("Location: thankyou.html");return; $headers .= "From: ".$from."\r\n"; $headers .= "Content-type: text/plain; charset=ISO-8859-1"; $your_domian_name = "http://www.lajingles.com/blog.php"; //edit what you want your vistors to see in their email here $subject = $from_name." wants you to know about the LAJingles Blog"; $your_message = "Hi!\r\n"; $your_message.= ucfirst($from_name); $your_message.= " wants you to check out $your_domian_name\r\n"; $your_message.= "-----------------------------------------------\n\r"; $message=$your_message." The LAJingles.com blog makes some interesting points about radio and TV advertising. Phil blasts commercials that are too loud and too obtuse, among other things. The website also has some other interesting stuff like news and weather, and even some comics pages. There's new stuff there everyday! It's worth a visit. http://www.lajingles.com/blog.php Take care... (This message was sent from the Tell-a-Friend form at LAJingles.com)"; if (mail($to,$subject,$message,$headers) ) { return true; } else { return false; } } function print_error($errors) { foreach($errors as $error) { $err.=$error."
"; } echo "
$err
"; } function form_process() { $from_name = $_POST["your_name"]; $from_email = $_POST["your_email"]; $to = $_POST["your_email"].",".$_POST["friend_email1"].",".$_POST["friend_email2"].",".$_POST["friend_email3"]; $message = $_POST["message"]; $error_count = validate_form_items(); if($error_count == 0) { if(email($from_email, $from_name, $to, $message)) header("Location: thankyou.html"); else { global $errors; $errors[] = "Email coudn't be sent at this time.
Please report this error to the webmaster."; } } } if( isset($_POST['submit'])) { if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { // Insert your code for processing the form here, e.g emailing the submission, entering it into a database. form_process(); echo 'Thank you. Your message said "'.$_POST['message'].'"'; unset($_SESSION['security_code']); } else { // Insert your code for showing an error message here echo '
Sorry, you have provided an invalid security code'; } } else { ?>
Your Name:* ">
Your Email:* ">
Friend's Email:*
">
Another Friend's Email:
">
...and Another Friend's Email?:
">
* required

Your message will say:
The LAJingles.com blog makes some interesting points about radio and TV advertising. Phil blasts commercials that are too loud and too obtuse, among other things. The website also has some other interesting stuff like news and weather, and even some comics pages. There's new stuff there everyday!

It's worth a visit.
http://www.lajingles.com/blog.php
Take care...