Jump to content

contact form issue


laxi
Go to solution Solved by laxi,

Recommended Posts

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 by laxi
Link to comment
Share on other sites

  • 1 month later...

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.