Jump to content


Photo

php to deliver flash form entries


  • Please log in to reply
4 replies to this topic

#1 perfekted

perfekted
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 September 2006 - 01:57 AM

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!

<?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) ;
?>


#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 04 September 2006 - 02:07 AM

You missed an double quote here

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

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

follow me on twitter @PHPsycho

#3 perfekted

perfekted
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 September 2006 - 11:14 PM

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:

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

?>

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!

#4 perfekted

perfekted
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 September 2006 - 11:31 PM

bumpity bump... i need help please! thanks =]

#5 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 06 September 2006 - 01:49 AM

Have you changed teh method attribute of the submitting form?

$to = "contact@perfekted.com";
$msg = "Name: " . $_POST['name'] ."\n";
$msg .= "E-mail Address: " . $_POST['email'] ."\n";
$msg .= "Message: " . $_POST['message'] . "\n";

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
follow me on twitter @PHPsycho




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users