Global In Mail Form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

Global In Mail Form

Post by Zeceer »

Hi,

I can't make this work for some reason.

Code: Select all

<?php

$to = "zeceer@hotmail.com";
$subject = "Order";
$headers = "zeceer@hotmail.com";

$body =

Navn: $_POST&#1111;'navn'];
Post adresse: $_POST&#1111;'postadresse'];
Postnummer: $_POST&#1111;'postnummer'];
Sted: $_POST&#1111;'sted'];
Telefon: $_POST&#1111;'telefon'];
E-mail: $_POST&#1111;'email'];

mail($to,$subject,$body,"From: $headers");

header( "Location: index.php" );

?>
I've tried a lot of methods, but doesn't get it right. Anyone?
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

uh try

Code: Select all

$body = "

Navn: $_POST&#1111;'navn']
Post adresse: $_POST&#1111;'postadresse']
Postnummer: $_POST&#1111;'postnummer']
Sted: $_POST&#1111;'sted']
Telefon: $_POST&#1111;'telefon']
E-mail: $_POST&#1111;'email']";
User avatar
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

Post by Zeceer »

uh no :D
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
this is on line 9 which is the line with the first variable. The name variable.
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

the syntax got munged here i think:

Code: Select all

&lt;?php

$to = "zeceer@hotmail.com";
$subject = "Order";
$headers = "zeceer@hotmail.com";

$body ="

Navn: $_POST&#1111;navn]
Post adresse: $_POST&#1111;postadresse]
Postnummer: $_POST&#1111;postnummer]
Sted: $_POST&#1111;sted]
Telefon: $_POST&#1111;telefon]
E-mail: $_POST&#1111;email]";

mail($to,$subject,$body,"From: $headers");

header( "Location: index.php" );

?&gt;
zebrax
Forum Newbie
Posts: 16
Joined: Sat Sep 14, 2002 11:39 pm

Post by zebrax »

Try

Code: Select all

&lt;?php

$to = "zeceer@hotmail.com";
$subject = "Order";
$headers = "zeceer@hotmail.com";

$body ="

Navn: ".$_POST&#1111;navn]."
Post adresse: ".$_POST&#1111;postadresse]."
Postnummer: ".$_POST&#1111;postnummer]."
Sted: ".$_POST&#1111;sted]."
Telefon: ".$_POST&#1111;telefon]."
E-mail: ".$_POST&#1111;email];

mail($to,$subject,$body,"From: $headers");

header( "Location: index.php" );

?&gt;
Post Reply