Jump to content

Archived

This topic is now archived and is closed to further replies.

perfekted

php to deliver flash form entries

Recommended Posts

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 15

I'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]

Share this post


Link to post
Share on other sites
You missed an double quote here

$content .= "Name: <b>" . $your_name . "</b><br>;

change that to
$content .= "Name: <b>" . $your_name . "</b><br>";

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

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.