June 30, 201214 yr i have a contact form that sends me info, but doesnt display it in the email, can anyone help? here is the code.. form <form name="form1" method="post" action="send_membership.php"> <table width="300" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="100">Subject</td> <td width="200"><input name="subject" disabled="disabled" type="text" id="subject" value="Membership" size="30"></td> </tr> <tr> <td>First Name</td> <td><input name="firstname" type="text" id="firstname" size="30"></td> </tr> <tr> <td>Last Name</td> <td><input name="name" type="text" id="lastname" size="30"></td> </tr> <tr> <td>Email</td> <td><input name="customer_mail" type="text" id="customer_mail" size="30"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </table> </form> php <?php header("Refresh: 5;url=http://www.mydomain.com/"); ?> <?php // Contact subject $subject ="$subject"; // Details $message="$firstname"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $firstname <$mail_from>"; // Enter your email address $to ='willows1990@gmail.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information, please <a href='index.php'>click here</a> to go back"; } else { echo "ERROR"; } ?> I just want it to display like this in the email membership first name last name email Edited July 3, 201214 yr by Renaissance-Design
June 30, 201214 yr theres nothing getting the posted values on the PHP file php file should be something like this <?php header("Refresh: 5;url=http://www.mydomain.com/"); ?> <?php $firstname = $_POST['firstname']; //this gets the posted values and puts them into a variable $name = $_POST['name']; $customer_mail = $_POST['customer_mail']; $subject = $_POST['subject']; $message="Name: $firstname $name<br /> Email: $customer_mail Membership: $subject"; $header="from: $firstname <$customer_mail>"; // Enter your email address $to ='willows1990@gmail.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information, please <a href='index.php'>click here</a> to go back"; } else { echo "ERROR"; } ?> the inputs should be sanitised to prevent hacking and a captcha or something along those lines would be helpful to avoid spamming Edited July 3, 201214 yr by Renaissance-Design
July 3, 201214 yr Author theres nothing getting the posted values on the PHP file php file should be something like this <?php header("Refresh: 5;url=http://www.mydomain.com/"); ?> <?php $firstname = $_POST['firstname']; //this gets the posted values and puts them into a variable $name = $_POST['name']; $customer_mail = $_POST['customer_mail']; $subject = $_POST['subject']; $message="Name: $firstname $name<br /> Email: $customer_mail Membership: $subject"; $header="from: $firstname <$customer_mail>"; // Enter your email address $to ='willows1990@gmail.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information, please <a href='index.php'>click here</a> to go back"; } else { echo "ERROR"; } ?> the inputs should be sanitised to prevent hacking and a captcha or something along those lines would be helpful to avoid spamming sorry for late reply, havent been in the office, this worked great thank you very much Edited July 3, 201214 yr by Renaissance-Design
July 3, 201214 yr Author Could you do me a favour and delete this thread as it shows up in the Google Listings when searching for the [redacted], thank you Edited July 3, 201214 yr by Renaissance-Design
July 3, 201214 yr Nope. What I can do is remove all mention though. In future, anonymize your posts. We kinda like leaving problems and solutions visible in case they can help someone else. Edited July 3, 201214 yr by Renaissance-Design
July 4, 201214 yr Author Nope. What I can do is remove all mention though. In future, anonymize your posts. We kinda like leaving problems and solutions visible in case they can help someone else. Thanks for your help Renaissance
Create an account or sign in to comment