Static Contact Form Process

<?php // Creare Contact Form Edited by Dane Bridgman 27/02/2015 (HONEYPOT NO CAPTCHA) //PASTE THE BELOW INTO YOUR CONTENT AREA ON PAGE //Enter Emails into the quotation marks below $youremail = ""; @extract($_POST); $name = stripslashes($name); $phone = stripslashes($phone); $email = stripslashes($email); $message = stripslashes($message); $captcha = @$_POST['ct_captcha']; // $date = (date ("F j, Y")); $time = (date ("H:i:s")); $IPnumber = getenv("REMOTE_ADDR"); $_POST['phone'] = preg_replace("/[\n\r]+/", "", $_POST['phone']); $_POST['name'] = preg_replace("/[\n\r]+/", "", $_POST['name']); $_POST['email'] = preg_replace("/[\n\r]+/", "", $_POST['email']); // $msg = " ///Enter your Company name below: COMPANY NAME Personnel Details ------------------------------------ Name: $name Email: $email Phone: $phone Location: $area Business Details ----------------------------------- Subject: $sub Message: $message ----------------------------------- Date of Enquiry: ".$date." at ".$time." IP Number: ".$IPnumber." "; $validstring = '^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3}))$'; if (!eregi($validstring,$email)&&$email) { $emailcorrect = 0; } if($_POST['website'] != ''){ echo "It appears you are a bot!"; } else { $emailcorrect = 1; } /* New Captcha Update Area */ //if ($valid->check($captcha) == false) { // $errors['captcha_error'] = 'Incorrect security code entered<br />'; // } if($email&&$name&&$message&&$emailcorrect&&$valid) { /* Captcha Update End */ ///Enter your company details below: if(mail($youremail, " From: COMPANY DETAILS Enquiry<$email>", $msg)) { echo " <table width='100%' border='0' class='tickyellowbox' cellpadding='10' cellspacing='0'> <tr> <td width='90%'><p>Your e-mail was sent to our Office.</p><br /><p>Thank you for your enquiry $name, you will be contacted shortly regarding your email.</p></td> </tr> </table> "; $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; $autoreply="Thank you for your message $name. We will respond to your email as soon as possible. This is an automated reply. //ENTER SITE URL BELOW Thank you for visiting our website http://www.mycompany.co.uk "; $subject="Thank you for your submission $name."; //Change Company Name Below mail($email, $subject, $autoreply, "From: COMPANY NAME - Email Confirmation<$email>"); } } // if(!$email||!$subject||!$name||!$message) { echo " <table width='100%' border='0' class='tickredbox' cellpadding='10' cellspacing='0'> <tr> <td width='90%'><p>Sorry, $name, your e-mail was not sent you have forgotten to fill in a detail.</p></td> </tr> </table> "; } if (!$emailcorrect) { echo " <table width='100%' border='0' class='tickredbox' cellpadding='10' cellspacing='0'> <tr> <td width='90%'><p>Sorry $name, your e-mail address is not valid.</p></td> </tr> </table> "; } ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.