PHP - Mail Form Redirect To Thankyou Page - Php Newbe
Hi people,
I am a complete newbe to php but can some one please help us out a little with a bit of code? Basically i have a contact form, when the user submits the form it gets processed by my php page and the data sent of to my email address. The thing is I have wrote most of the code for this and i think it should work, however i want to add a bit of code that re-directs the user to a "thank you" page after they submit the form. I hope that makes sense, please check out the code below and please let me know what and where to put the re-direct code, please also let me know if the code i have written so far is correct. my code Code: [Select] <?php if(isset($_POST['submit'])) { $to = "me@my_email_address.com"; $subject = "Contact Form"; $name = $_POST['name']; $comp_name = $_POST['company_name']; $email = $_POST['email']; $phone = $_POST['contact_number']; $location = $_POST['location']; $message = $_POST['message']; $body = "From: $name\n E-Mail: $email\n Company Name: $comp_name\n Contact Number: $phone:\n Location: $location:\n Message:\n $message"; mail($to, $subject, $body); } ?> Cheers people, hope some one can help. Similar TutorialsFirst, I would like to say hi to everyone, I just registered, so I am new to the forums! But at any rate, I have a question. I have a form that I have programmed in PHP and upon completion of the form, sends the inputed information to my clients e-mail (acts as a lead) and redirects the user to the main part of the website, where you can access all of the content. Now, I need a little assistance on how to make it so if the same user comes back to the site again, they won't always have to fill out the form and it will just forward them to the main page. Clarification: This is what I'm trying to figure out When you go to the url for the first time, the index page has the form on it that must be filled out before you can access the rest of the pages on the website (I have this set as a redirect in the php processing after you submit the form). What coding would I have to add to the html on the form page (index) and/or my php processor and/or the html on the page you are redirected to? My overall goal is for the user to only see the form page once, after they have submitted it the first time, the next time they visit the url, I want them automatically re-directed to the main part of the site since they already completed the form. For Example: (I have this part programmed and working already) The user goes to http://www.example.com for the first time and they see the page with the form on it. They fill it out and click "Submit" and are re-directed to http://www.example.com/page2.html, this redirect is handled with a header "location" command. (This is the part I need help with) At a future time the same user returns to http://www.example.com and since they have already filled out the form they are automatically re-directed to http://www.example.com/page2.html without having to hit the "Submit" button or really even see the form page. Thank you very much in advance, I appreciate your help! I am fairly new to PHP and am having an issue with getting my form to redirect to a thank you page upon sending the form email. I currently have it set to echo a thank you message but it needs to be changed to ensure that we can track all form fills better. I have tried the header method but it doesn't work correctly based on how the website is designed. It seems like there should be an easy way without redesigning too much. Are there any other ways to accomplish this? Please let me know what I need to do in order to get the redirect to work. Hi, I have this simple e-mail script that I am modifying to my liking. I know how to do everything I want to do, except make the script e-mail the recipient the page title and url link of the website page this is form is sent from. Since the link to this file will be included in pretty much every page on my site, I can't put static url links and page titles in the code below. I need a way for the page title and url to be pulled from the active page and be displayed in the e-mail once the person receives it. Just to be clear how this will work; there will be a link on every web page that people can click that will pop-up a window that will have this form & script in it where they can enter in their e-mail, a friends e-mail and a message and then send it off. I have tried a bunch of methods myself, but I am not getting good results. Can anyone help me with this? I am at my wits end. Thanks! Code: [Select] <?php //minimum characters allowed in the message box $msg_min_chars = "10"; //maximum characters allowed in the message box $msg_max_chars = "250"; $errors = array(); function validate_form_items() { global $msg_min_chars, $msg_max_chars; $msg_chars = "{".$msg_min_chars.",".$msg_max_chars."}"; $form_items = array( "name" => 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 = "www.yourdomain.com"; //edit what you want your vistors to see in their email here $subject = $from_name." sent you an invitation to $your_domian_name"; $your_message = "Hi!\r\n"; $your_message.= ucfirst($from_name); $your_message.= " wants you to check out $your_domian_name\r\n"; $your_message.= "Sender's Message:\n\r"; $message=$your_message.stripslashes($message); if (mail($to,$subject,$message,$headers) ) { return true; } else { return false; } } function print_error($errors) { foreach($errors as $error) { $err.=$error."<br/>"; } echo "<div style=\"border:1px red solid; font-size:14px; font-weight:normal; color:red; margin:10px; padding:10px;\"> $err <div>"; } 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 send at this time. <br>Please report the webmaster of this error."; } } } if(isset($_POST["submit"])) form_process(); ?> I have two pages. one is insert_events.php and the other is veiw_events. In insert_events i have a form which have a submit button. I want when i click on the submit button, it redirects me to the view_events.php page showing the events. Any idea about this problem will be appreciated. Thanks Ive tried using header and form action and my page will not load into another page after submitting ! Any ideas?
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Task2 - App</title> <meta name="description" content="The Task2 App"> <meta name="author" content="SitePoint"> </head> <body> <h1>Task 2 - Web App</h1> <br><br> <div class ="submission"> <form action="" method="POST" name='submit'> <label>N:</label> <input type="text" name="number-entered" id="number"/> <input name="form" type="submit" value="Submit"/> <br><br> </form> </div> </body> </html> <?php $number = $_POST['number-entered']; $form_result = $_POST['form']; if(isset($form_result)) { if(($number < 5) || ($number > 25)) { echo 'Input out of range'; } else { $number = $_POST['number-entered']; foreach ( range(1, $number) as $i ) { $triangle_numbers[] = $i * ( $i + 1 ) / 2; } //make a file $contents = fopen('gs://a1-task22020.appspot.com/triangular_' .$number. ".txt", "w"); fwrite($contents,implode(',', $triangle_numbers)); //open the file $contents = fopen('gs://a1-task22020.appspot.com/' . $content, 'w'); //re-open the document if you put something in it fwrite($contents, $number); fclose($contents); } } ?>
Can anyone provide a snip of code that I could insert into the "coupon code" field on a formmail form which has the following effect: on submit form, user goes to the normal payment page (this is already implemented) if coupon code field is filled out with correct code, user is taken to alternate payment page on form submit. Either this or another approach which has the same result is OK. I am a novice coder working in a wysiwyg - I don't REALLY know php at all - I just need a snip I can insert and a clear instruction. Thanks so much for any help. system: vista ultimate sp2 IIS 7 server installed and running PHP 5 fastCGI im not sure if this is within the purview of the forum but you all seem like smart people with an expertise in this area. i have a web site http://penumbraproductions.dyndns-remote.com/ . it is hosted locally on my desktop using the above mentioned IIS7 server options using dyndns to list the url cause my ISP has DHCP without static ip's for non-business accounts that has a contact form... form mail. i've tried numerous php codes to get it to send mail to my email account but none of them are working my IIS smtp setting a email to: archaismic@gmail.com smtp server: smtp.gmail.com port number: 465 using login credentials i've also tried to configuring the smtp options in IIS to dump the mail to a folder on my computer which also did not work attached is the feedback.php file im currently working with minus the captcha private key and the code for the form i'm using is: Code: [Select] <form action="feedback.php" method="post"> <table border="0" cellpadding="8" cellspacing="8"> <tr><td><label for="tswname">Name</label>:</td><td><input type="text" name="fullname" id="tswname" size="25" /></td></tr> <tr><td><label for="tswemail">Email address</label>:</td><td><input type="text" id="tswemail" name="email" size="25" /></td></tr> <tr> <td colspan="2"> <label for="tswcomments">Comments</label><br /> <textarea rows="15" cols="45" name="comments" id="tswcomments"></textarea> </td> </tr> <tr> <td align="center" colspan="2"> <script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LcYjcASAAAAAH1NwZ0IH_TUO4XDANZqWu3Ei9yh"></script> <noscript> <iframe src="http://api.recaptcha.net/noscript?k=6LcYjcASAAAAAH1NwZ0IH_TUO4XDANZqWu3Ei9yh" height="300" width="500" frameborder="0" title="CAPTCHA test"></iframe> <br /> <label for="tswcaptcha">Copy and paste the code provided in above box he </label><br /> <textarea name="recaptcha_challenge_field" id="tswcaptcha" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge" /> </noscript> </td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="Send Feedback" /> </td> </tr> </table> </form> I have a notification system that notifies users of new comments, inside the email I have images, some of the logo, some of different people, everything shows up fine on my computer (yahoo email), however in the iPhones email application no images show up, there are just the blue squares with the question marks in them. I'm not sure what I'm missing. Code: [Select] $from = "Kithell <notifications@kithell.com>"; $headers = "From:" . $from ."\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $subject = name($from_id, 'fl').$action; $message = '<html><body> <style>@charset "utf-8"; /* CSS Document */ .e-container { background-color: #FFF;position: relative;width: 90%;min-height:1px;margin-right: auto;margin-left: auto; } .e-container .e-m-header { padding: 2px; background-image: url(http://www.kithell.com/assets/tall-grey-header.png); background-repeat: repeat-x; border: 1px solid #CCC; background-position: bottom; display: block; text-align: center; } .e-container p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #666; vertical-align: text-top; display: inline-block; } .e-container .e-usr-photo { display: inline-block; margin: 10px; float: left; background-color: #F4F4F4; } .e-container p a { font-weight: bold; color: #3F60A3; text-decoration: underline; padding: 0px; float: left; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 0px; } .e-container .e-quotes { font-size: 20px; font-weight: bold; color: #999; font-family: Tahoma, Geneva, sans-serif; display: block; padding: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 75px; margin-top:10px; } .e-container .e-message { font-size: 13px; color: #333; padding: 0px; margin-top: 0px; margin-right: 10px; margin-bottom: 0px; margin-left: 10px; clear: none; display: inline; }</style> <div class="e-container"><div class="e-m-header"><img src="http://www.kithell.com/assets/kithell-logo.png" /></div><img class="e-usr-photo" src="http://www.kithell.com/'.photo($from_id, 55).'" /><br /><p><a target="_blank" href="http://www.kithell.com/#/profile&id='.$from_id.'">'.name($from_id, "fl").' </a> '.$action.'<div class="e-quotes">"<p class="e-message">'.nl2br(htmlentities(stripslashes($message))).'</p>"</div></p></div></body></html>'; mail($to,$subject,$message,$headers); Hello, I am new in php and have made only little so fare. I am trying to make a script, but the script stops. I dont know how loops work. Quote <?php $lenkzeit = 4.5; $lenkunter = 1; $ruhezeit1 = 11; $ruhezeit2 = 9; $stunden1 = 0; $km = 1000; $kmh = 80; $stunden0 = $km/$kmh; $stunden01 = $stunden0; while ($stunden01 > $lenkzeit){ $stunden1 = $stunden1 + $lenkzeit + 1; $stunden01 = $stunden01 - $lenkzeit; //Stops here if ($stunden01 > $lenkzeit) { $stunden1 = $stunden1 + $lenkzeit + $ruhezeit; $stunden01 = $stunden01 - $lenkzeit; } } if ($stunden01 < $lenkzeit) { $srunden1 = $stunden1 + $stunden01; $stunden01 = 0; } echo $srunden1; ?> Hi guys, Please can anyone help me with a simple bit of PHP. I'm just starting out, so its all a bit confussing to me. Basically I need a bit of code that does something like this: My end user types in a password on a form on the html page. The pasword is checked by the php page. If pasword is correct the user gets sent to another page within my site. If pasword is incorrect the user gets sent to an error page within my site. I know this is real simple stuff, but as i said i'm realy new to this, hope some one can help. Cheers People. Hi people, please can any of you guys help us out? I need to write some php code but i'm getting more and more confused everytime i get into php. Anyways this is what i'm trying to do on my site: I want the user to type in a company name in a text field in a very simple html form. The user hits submit buton and the text the user typed in gets sent to a php document for processing. If the user has typed in a company name that matches one of the 3 company names that i have, then the user gets sent to one page. (sucess page) If the what the user has entered into the search form does not match one of my 3 company names, then I want them to be sent to another page (error page). I know this is real simple stuff guys, but i just cant get my head round this so far, please, please help. Many thanks in advance, Marcus. This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=347009.0 Hi, I have a, let's call it, Main page, and it refreshes every 5 seconds to check the database... If it finds a result, it kills the refresh function and allows a DIV to call a page into itself via another function on the Main page, which refreshes every second, it's a timer count down clock... The problem is, that if the timer runs down to zero, I have it do a lot of things, but then I need it to either refresh the Main page, redirect the Main page, or close the Main page entirely... Does anyone know how I could perform either 3 of those actions from within the page that's inside of the DIV? Hi,
I am trying to redirect a page to another page based on if the page contains an image with an exact source.
I have this so far:
if ( $("span#bannerhold:has(img[src='http://www.website.com/images/banners/banner1.gif'])")){ location.href = "http://www.google.com" }However it doesn't seem to work. Any ideas why? Thanks! Hello, Please... could someone look at my existing code below at tell me how I can establish a REDIRECT PAGE {header("Location: thankyou.php");} to fit in my code and WITHOUT generating a MySQL error once the php page is processed on the server? I wish to place the HTML CODE at bottom of my page labeled " // THE RESULTS OF THE FORM RENDERED AS PURE HTML " to be on a separate " thanks.php " page. thanks mrjap1 Code: [Select] <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $registration_date = $_POST['registration_date']; // 1. Create a database connection $con = mysql_connect("localhost","mrino_mydata","runns100"); if (!$con) { die('Database connection failed could not connect: ' . mysql_error()); } // 2. Select a database to use $db_select = mysql_select_db("mrino_FULLENTRYDATA",$con); if (!$db_select) { die('Database selection failed could not connect: ' . mysql_error()); } mysql_select_db("mrino_FULLENTRYDATA", $con); // Data Submitted With My Form $sql="INSERT IGNORE INTO `mrino_FULLENTRYDATA`.`backpage1` (`id` , `first_name` , `last_name` , `email` , `registration_date`) VALUES (NULL , '$_POST[first_name]' , '$_POST[last_name]' , '$_POST[email]', NOW( ))"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } // 3. Close Connection mysql_close($con); ?> <?php // ALL THE SUBJECT and EMAIL VARIABLES $emailSubject = 'MY TEST EMAIL SCRIPTING!!! '; $webMaster = 'myemailaddress@gmail.com'; // GATHERING the FORM DATA VARIABLES $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $registration_date = $_POST['registration_date']; $date = date ("l, F jS, Y"); $time = date ("h:i A"); $body = <<<EOD <br /><hr><br /> <strong>First Name:</strong> $first_name <br /> <strong>Last Name: </strong>$last_name <br /> <strong>Email:</strong> $email <br /> <strong>Registration Date:</strong> $date at $time <br /> EOD; // THIS SHOW ALL E-MAILED DATA, ONCE IN THE E-MAILBOX AS READABLE HTML // Remove Header Injections $match = "/(bcc:|cc:|content\-type:)/i"; if (preg_match($match, $from) || preg_match($match, $subject) || preg_match($match, $body)) { die("Header injection detected."); } // Simple filtering on all of our input variables $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); $from = preg_replace("([\r\n])", "", $_POST['email']); $emailSubject = preg_replace("([\r\n])", "", $_POST['$emailSubject']); // THE RESULTS OF THE FORM RENDERED AS PURE HTML $theResults = <<<EOD <!DOCTYPE HTML> <html lang="en"> <head> <style type="text/css"> body { font-family:Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; } #thankyou_block { width: 400px; height: 250px; text-align:center; border: 1px solid #666; padding: 5px; background-color: #0CF; border-radius:8px; -webkit-border-radius:8px; -moz-border-radius:8px; -opera-border-radius:8px; -khtml-border-radius:8px; box-shadow:0px 0px 10px #000; -webkit-box-shadow: 0px 0px 10px #000; -moz-box-shadow: 0px 0px 10px #000; -o-box-shadow: 0px 0px 10px #000; margin: 25px auto; } p { font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; letter-spacing:1px; color: #333; } </style> <meta charset="UTF-8"> <title>THANK YOU!!!</title> </head> <body> <div id="thankyou_block"> <br><br><br> <h1>CONGRATULATIONS!!</h1> <h2>YOUR FORM HAS BEEN PROCESSED!!!</h2> <p>You are now registered in our Database...<br> we will get back to you very shortly.<br> Please have a very wondeful day.</p> </div> </body> </html> EOD; echo "$theResults"; ?> Hello everyone, I am creating a site that has two modes 1.Default 2.under construction I use database to see weather the site is under construction or not. The template of under construction is different and is stored in a another directory eg: site url: www.my.com under construction page: www.my.com/uc now i want that when the database is selected for under construction the URL should show www.my.com not www.my.com/uc Please help me with this. I tried to redirect with header(location: '.......'); but in the URL it shows www.my.com/uc Thanks. hello, so i have this contact page on my website, but i want people to actually know if the mail got sent or not, so i first have contact.php, which sends all the information to sendmail.php, which in turn tells redirect.php wether or not the mail was sent, and redirect.php then shows this information for the user to see, and has a 10 second timer before users get sent back.. here is the website: http://hcg.drokz.eu.clanservers.com/ all files are in the same folder so here is my code: Code: (sendmail.php) [Select] <?php $url1 = 'redirect.php?sent=sent'; $url2 = 'redirect.php?sent=fail'; $timeout = 0; ?> <?php $to = "admin@hcg.drokz.eu.clanservers.com"; $name = $_REQUEST['name'] ; $subjectm = $_REQUEST['subject'] ; $subject = "contact form entry on the hcg website by $name with the subject $subjectm"; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; ?> <?php if($sent) {header('Refresh: ' . $timeout . ';url=' . $url1); ?> <meta http-equiv="refresh" content="<?php echo($timeout) ?>;url=<?php echo($url1); ?>"> <script type="text/javascript"> setTimeout(function(){window.location.replace("<?php echo($url1); ?>";}, <?php echo($timeout * 1000); ?>); </script> <?php } ; ?> <?php else {header('Refresh: ' . $timeout . ';url=' . $url2); ?> <meta http-equiv="refresh" content="<?php echo($timeout) ?>;url=<?php echo($url2); ?>"> <script type="text/javascript"> setTimeout(function(){window.location.replace("<?php echo($url2); ?>";}, <?php echo($timeout * 1000); ?>); </script> <?php } ; ?> <a href='contact.php'> this page should redirect you, if nothing happens, click here! </a> Code: (redirect.php) [Select] <?php $sent = $_GET['sent'] ; ?> <?php $url = 'contact.php'; $timeout = 10; ?> <?php header('Refresh: ' . $timeout . ';url=' . $url); ?> <meta http-equiv="refresh" content="<?php echo($timeout) ?>;url=<?php echo($url); ?>"> <script type="text/javascript"> setTimeout(function(){window.location.replace("<?php echo($url); ?>";}, <?php echo($timeout * 1000); ?>); </script> <h1> <?php if($sent == sent) {echo "Success!" } ; elseif($sent == fail) {echo "Failure!" } ; ?></h1> <?php if($sent == sent) {echo "your email has been sent successfully and we will reply as soon as we can."} ; elseif($sent == fail) {echo "we have encountered a problem while sending your email, please try again!"} ; ?> <p> <a href='contact.php'> this page will redirect you in 10 seconds, if nothing happens or you can't wait, click here! </a> Hai Folks,
Please help me in this situation,
Actually my case is bit complicated
i have a list of few movies.please check the attached file.
If we click on each movies ,i want to direct into next page describing details of that clicked movie (review,image,syopsis,time).can you help me to write code
following is the code for showing movie list.
<?php Hey everyone. I am extremely new to PHP coding and I wanted to take a shot at making a basic mail form submission. I have done a lot of research and cannot get my test files to work. No e-mails get sent to me. I appreciate any help you can offer. Here are the following pages: http://www.insightguild.com/contactformpage.html http://www.insightguild.com/sendmail.php (coding is viewable when you navigate to this file) I am using Bluehost.com as my hosting server. Thanks I have a pretty good php mailer script, but how do I get the senders email? When I test the form, the users email doesn't appear in the "From" field. Anyone know what I need to add to my code? Thanks. <?php if (array_key_exists('send', $_POST)) { // mail processing script // remove escape characters from POST array if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); } $from = 'Emailer Form'; $to = 'myEmail.com'; $subject = 'Interested in Urban Style Ballroom Dancing'; // list expected fields $expected = array('name', 'phone', 'email', 'address', 'city', 'state', 'zip', 'emailerMessage'); // set required fields $required = array('name', 'phone', 'email', 'address', 'city', 'state', 'zip', 'emailerMessage'); // create empty array for any missing fields $missing = array(); // process the $_POST variables foreach ($_POST as $key => $value) { // assign to temporary variable and strip whitespace if not an array $temp = is_array($value) ? $value : trim($value); // if empty and required, add to $missing array if (empty($temp) && in_array($key, $required)) { array_push($missing, $key); } // otherwise, assign to a variable of the same name as $key elseif (in_array($key, $expected)) { ${$key} = $temp; } } // go ahead only if all required fields OK if (empty($missing)) { // build the message $message = "name: $name\n\n"; $message .= "phone: $phone\n\n"; $message .= "email: $email\n\n"; $message .= "address: $address\n\n"; $message .= "city: $city\n\n"; $message .= "state: $state\n\n"; $message .= "zip: $zip\n\n"; $message .= "emailerMessage: $emailerMessage\n\n"; // limit line length to 70 characters $message = wordwrap($message, 70); // send it $mailSent = mail($to, $subject, $message); if ($mailSent) { // $missing is no longer needed if the email is sent, so unset it unset($missing); } } } ?> |