perfekted Posted September 4, 2006 Share Posted September 4, 2006 Hey all! I'm a newbie to PHP and it's stumping me left and right. Here's my website: www.perfekted.com. I need to make the form on the contact page functional, and deliver the results to my email. I already have a php file connected to it, but if you fill out the form and attempt to submit, I get another window with an error message reading:Parse error: parse error, unexpected T_STRING in /home/perfekt/public_html/temp/contact.php on line 15I've looked at the php file and cannot figure out what the problem is. Below is the code I'm using. Can someone help please? Thanks in advance![code]<?php$your_name = $_GET['name'];$your_email = $_GET['email'];$your_message = $_GET['comment'];$sendTo = "perfekted@gmail.com";$subject = "from " . $your_email;$headers = "From: " . $your_name . " <" . $your_email . ">\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' ;$content = "<html><head><title>Contact Letter</title></head><body><br>";$content .= "Name: <b>" . $your_name . "</b><br>;$content .= "E-mail: <b>" . $your_email . "</b><br>;$content .= $your_message;$content .= "<br></body></html>";mail($recipient_email,$subject,$content,$headers) ;?>[/code] Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 4, 2006 Share Posted September 4, 2006 You missed an double quote here$content .= "Name: <b>" . $your_name . "</b><br>;change that to$content .= "Name: <b>" . $your_name . "</b><br>"; Quote Link to comment Share on other sites More sharing options...
perfekted Posted September 4, 2006 Author Share Posted September 4, 2006 Thanks a lot ToonMariner. You were absolutely right. I made some adjustments so that things are a lot simpler. here's the new code, and new problem:[code]<?php$to = "contact@perfekted.com";$msg = "Name: $_POST[name]\n";$msg .= "E-mail Address: $_POST[email]\n";$msg .= "Message: $_POST[message]\n";mail($to, $subject, $msg, "From: I love perfekted!\nReply-To: $email\n");?>[/code]I get the emails just fine, but all that's in the body is:Name:E-mail Address:Message:It's not delivering the info from the user imput fields. Can someone help please, It's much appreciated! thanks! Quote Link to comment Share on other sites More sharing options...
perfekted Posted September 5, 2006 Author Share Posted September 5, 2006 bumpity bump... i need help please! thanks =] Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 6, 2006 Share Posted September 6, 2006 Have you changed teh method attribute of the submitting form?[code]$to = "contact@perfekted.com";$msg = "Name: " . $_POST['name'] ."\n";$msg .= "E-mail Address: " . $_POST['email'] ."\n";$msg .= "Message: " . $_POST['message'] . "\n";[/code]I notice that you have used the $subject ijn your script but in your last post it was not defined anywhere...If you haven't changed the method of your form then just replace $_POST with $_GET 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.