laxi Posted September 6, 2013 Share Posted September 6, 2013 (edited) Hi, I am pretty new to PHP and i am currently working on a website. I am having an issue with contact Us form on my webpage. It is always displaying a message when you open the contact form: "Your email has been sent to our web team. Please allow a 24 hour response time". Also, when the wrong security answer is typed and the form is submitted it does not echo the failure message as programmed.Can someone check the code for me. The site is http://allplaybig.com I have 2 php pages for the contact form. 1) contact.php 2) phpcontact.php the relevent php codes are listed below for both pages: a) contact.php +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= <?php $s=$_GET['s']; if($s="1") {echo('<span class="success">Your email has been sent to our web team. Please allow a 24 hour response time </span>');} else if($s="2") {echo('<span class="fail">Sorry ! Your message has not been sent to our web team. Please fill the form correctly and try again </span>');} ?> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ phpcontact.php <?php $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $email=$_POST['email']; $tel=$_POST['tel']; $security=$_POST['security']; $enquiry=$_POST['message1']; $to= "laxmon@allplaybig.com"; $subject= "New message from allplaybig.com visitor"; $message="A visitor of allplaybig.com has submitted the contact us form with the below details\n\n First name:$firstname\n\n Last name:$lastname \n\n Email:$email \n\n Telephone: $tel\n\n Customer says- $enquiry"; if($security=="6"){ mail($to,$subject,$message); header("location:contact.php?s=1"); }else{ header("location:contact.php?s=2"); } ?> Edited September 6, 2013 by laxi Quote Link to comment Share on other sites More sharing options...
Solution laxi Posted September 6, 2013 Author Solution Share Posted September 6, 2013 resolved..thanks Quote Link to comment Share on other sites More sharing options...
silee Posted November 2, 2013 Share Posted November 2, 2013 Hi thereI am hoping you may get this message as I am having the exact same problem and my code looks similar, maybe from the same tutorial. I am not sure how you fixed the issue but was wondering if you could show me what you did? I have been fiddling with it for a couple of days now and not sure what else to try. I would be grateful for any help!!! Thanks! From contact.php file: <?php $s=$_GET['s']; if($s="1") {echo('<span class="success">Your email has been sent to our web team. Please allow a 24 hour response time </span>');} else if($s="2") {echo('<span class="fail">Sorry ! Your message has not been sent to our web team. Please fill the form correctly and try again </span>');} ?> As well as the css in my head section: <style type="text/css"> .success { color: #333300; margin-left: 15px; } .fail { color: #993300; margin-left: 15px; } </style> _____________________ send.php file: if($security=="10"){ mail($to,$subject,$message); header("location:contact.php?s=1"); } else{ header("location:contact.php?s=2"); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.