View Full Version : What is wrong with my php?
Gilla
December 11th, 2003, 05:31 AM
I'm sorry for this but I am new to php and I have used the tutorials to get a mail to form to work in flash, the flash part is working but when I view the php file in a browser it keeps telling me there are errors in line 3, what am I doing wrong?
<?PHP
$to = "james@.........co.uk";
$msg =_"$email\n\n";
$msg .=_"$subject\n\n";_
$msg .=_"$message\n\n";_
mail ($to ,_ $subject ,_ $msg ,_ "For:_Mail Us\n Reply-To:_$email\n");
?>
Thanks
mindfriction
December 11th, 2003, 06:07 AM
Why do you have all the '_' ??
Gilla
December 11th, 2003, 06:10 AM
It's the way it was in the tutorial, is that whats wrong?
mindfriction
December 11th, 2003, 06:21 AM
Ok, what you have seems a bit odd, try something like below
//mail($to, $subject, $message, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
Gilla
December 11th, 2003, 06:31 AM
Thanks for that.
Now I get this:
Warning: mail(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in /home/therm10553/public_html/pages/mail.php3 on line 2
But I have a feeling that is to do with the server its on.
Thanks.
mindfriction
December 11th, 2003, 06:37 AM
yeah sounds like the server to me. Sorry I couldnt be of more help mate, im having issues with the mail() function myself :/
Gilla
December 11th, 2003, 07:11 AM
You were a great help, thank you.
mindfriction
December 11th, 2003, 07:36 AM
Hey Gilla by the way www.php.net has some good examples of how to use the mail() function also some kind souls have posted their solutions and functions they use for mailing using php...
..you will find that initially mail sent using the mail() maybe filtered out as 'spam' or junk mail in hotmail for example so you will need to look into adding the appropriated headers :)..anyway all explained in php.net and various googling :P
Gilla
December 11th, 2003, 09:33 AM
Cheers, your a star. The Safe mode problem is server related they have disabled the 5th parameter.
You've been a great help thanks
Jinxboy
December 11th, 2003, 03:39 PM
when php runs in safe mode, just go complaining at your host, cus that's not what u paid for!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.