Re: newbie mail() function

From: Date: Wed, 07 Feb 2001 16:45:05 +0000
Subject: Re: newbie mail() function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38562@lists.php.net to get a copy of this message
Your ''s in your strings are the problem. They need to be escaped, or they will create a parse error. Instead of $msg = "Sender's Full Name:\t$user_name\n"; you should have > $msg = "Sender\'s Full Name:\t$user_name\n"; ----- Original Message ----- From: "Angerer, Chad" <cangerer@ibsys.com> To: <php-general@lists.php.net> Sent: Wednesday, February 07, 2001 10:36 AM Subject: [PHP] newbie mail() function > Hello! > > I am very new to php programming. I have been experimenting around with > php's mail function and html forms. > > I have a generic HTML form with user_name, email_address, comments, and > like_site as inputs on the HTML > form. I have the following code in a seperate php file which the form calls: > > <?php > > $msg = "Sender's Full Name:\t$user_name\n"; > $msg .= "Sender's Email Address:\t$email_address\n"; > $msg .= "User Comments:\t$comments\n"; > $msg .= "Did you like the site?\t$like_site\n\n"; > > $mailheaders = "From: My Web Site\n" > 9>$mailheaders .= "Reply-To: $email_address\n\n"; > > mail("cangerer@ibsys.com", "Feedback Form", $msg, $mailheaders); > > echo ("Thank you $user_name\n<br>"); > echo ("I appreciate your feedback\n\n"); > > ?> > > for some reason I get a parse error on line 9. If I remove the mailheaders > variables the PHP script works > just fine and emails the form to the correct address. Any help on this > would be appreciated. > > It is probably something qyite simple. I just don't see it though. > > Thanks. > > Chad > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#38562) next »