- This topic is empty.
-
AuthorPosts
-
March 1, 2011 at 10:50 am #31831pkinchlaParticipant
So My contact form was working fine for awhile and for some unknown reason it stopped working. I am pretty sure I have not altered the php at all and everything looks to be in order. Any suggestions are much appreciated.
Here is the php:
$name = $_REQUEST ;
$email = $_REQUEST ;
$comment = $_REQUEST ;
mail( "[email protected]", "Feedback Form Results",
$comment, "From: $email" );
header( "Location: http://paulkinchladesign.com/formfill.html" );
?>
here is the markup:
here is the page:
March 1, 2011 at 12:33 pm #57447Tim_at_PlattFormAdMemberNot sure if this will make a difference, but in your PHP you are grabbing the form values using $_REQUEST. Your form is set to method=”post” — meaning you should maybe be using the $_POST option instead?
$name = $_POST ;
$email = $_POST ;
$comment = $_POST ;
?>
March 1, 2011 at 10:53 pm #57207richtestaniMemberYou should write conditions to make sure things are working.
if(mail(...)) {all good}
Or look elsewhere in your page, sometimes it’s not related to that part.
March 1, 2011 at 11:13 pm #57209pkinchlaParticipantThanks for the responses, So I made the changes suggested and I get served this message when completing the form now:
Parse error: syntax error, unexpected ‘;’ in /home/content/p/k/i/pkinchla3345/html/contact.php on line 7
So I should assume the error is in line 7 I guess? Sorry Php is realllly new to me.
March 2, 2011 at 1:03 am #57215Ethan27MemberHey dude
PHP is new to me too. One thing I have heard is to stay away from $_REQUEST.
Also if the error is on line 7 its worth looking at line 6.
Sorry I couldnt help more but like you Im still learning.
March 2, 2011 at 12:34 pm #57174Tim_at_PlattFormAdMemberCould you post what your contact.php code looks like now?
March 2, 2011 at 12:39 pm #57166pkinchlaParticipantYeah I have made some changes and got it too work I think here is the code again:
$to = "[email protected]";
$subject = $_POST ;
$email = $_POST ;
$comment = $_POST ;
$headers = "From: $email";
$sent = mail($to, $subject, $comment, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>I also changed the markup slightly:
It seems that some go through and some do not at varying timeframes that I receive them in my email.
Thanks again for all the help!
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.