Jump to content

php to deliver flash form entries


perfekted

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]
Link to comment
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!
Link to comment
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
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.