Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple - Please Help

Status
Not open for further replies.

theredqueen

Programmer
Oct 26, 2001
40
GB
Ok i'm having trouble with a very simple form mail script.
Basically I have a form at
which goes to

the php is

<?php
mail( &quot;webmaster@theredqueen.net&quot;, &quot;Interactive CD Order&quot;,
&quot;$message&quot;,&quot;From: $name $email\n&quot;,&quot;Address : $address\n&quot;,&quot;Postcode : $postcode\n&quot;,&quot;Amount required : $amount\n&quot;,);
header( &quot;Location: );
?>

When i run i get this error :

Parse error: parse error in /home/sites/site37/web/cd/order.php on line 3

and i can't work out what it is...
i know this is dumb for most of you but please help!
cheers,
J x
 
Have a look at your documentation for this method. I think you have a few too many things in there:

Also watch where you put your &quot;;&quot;'s.


bool mail (string to, string subject, string message [, string additional_headers [, string additional_parameters]])


Other info like sender are aded as headers. The manual describes this very well.

 
Ok - I dont *really* get that - but someone's managed to get an email through &quot;splitapplerock&quot;?

So - is there any better way of accepting forms via email then?
J x
 
Thanks for all you're help.
I found out it involved the sequencing of parameters, as activeX was edging towards. I eventually cmae up with this.

<?
$UserMessage = &quot;$UserName, Thank you for submiting order at theredqueen.net.\n&quot;;
mail(&quot;$UserEmail&quot;, $UserMessage, &quot;From: webmaster@theredqueen.net&quot;, &quot;Thanks for submitting you're order, we'll be in contact soon. theredqueen.net&quot;);
$MyMessage = &quot;$UserName, Submitted the following information:\n&quot;;
$MyMessage .= &quot;Email: $UserEmail\n&quot;;
$MyMessage .= &quot;Address: $UserAddress\n&quot;;
$MyMessage .= &quot;Postcode: $UserPostcode\n&quot;;
$MyMessage .= &quot;Amount: $UserAmount\n&quot;;
$MyMessage .= &quot;Comments:\n&quot;;
$MyMessage .= &quot;$UserComments\n&quot;;
mail(&quot;webmaster@theredqueen.net&quot;, &quot;Interactive Cd Order Form&quot;, $MyMessage, &quot;From: $UserEmail&quot;);
header( &quot;Location: );
?>

This way, all the variables are put into one string and it works! wahoo
cheers,
j x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top