View Single Post
  #3 (permalink)  
Old May 1st, 2008, 17:02
Craigj1303 Craigj1303 is offline
SuperMember

SuperMember
Join Date: Apr 2007
Location: UK
Age: 31
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Directing user to a "thanks" page

Hi,
Thanks for replying. As I say I have no PHP knowledge at all at the moment so I just pasted your suggested code in to my mailer.php file but now when I post the form I get this message:

Quote:
Parse error: syntax error, unexpected T_VARIABLE in /home/fhlinux163/a/anyoldirons.me.uk/user/htdocs/mailer.php on line 14
Can you tell me exactly where I should paste your code in relation to my PHP below and whether I need to remove anything from it?

PHP: Select all

 <?php 
if(isset($_POST['submit'])) { 
$to "xxxxxxxxxx@hotmail.com"
$subject "Matchday Programmes"
$name_field $_POST['name']; 
$email_field $_POST['email']; 
$message $_POST['message']; 

$body "From: $name_field\n E-Mail: $email_field\n Message:\n $message"

echo 
"Data has been submitted to $to!"
mail($to$subject$body); 
} else { 
echo 
"blarg!"

?>
Thanks & Rgs

Craig

Last edited by Aso; May 1st, 2008 at 18:11.
Reply With Quote