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");
}
?>