RE: [PHP] character problem

From: Date: Mon, 12 Feb 2001 17:13:58 +0000
Subject: RE: [PHP] character problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39230@lists.php.net to get a copy of this message
PHP is doing what it should to your form input. It automatically performs "addslashes" to all form input so that the variables are parsed correctly on the receiveing end. do a "stripslashes" to get rid of it. read the manual on these two and it will all be explained. Dave -----Original Message----- From: John P. Donaldson [mailto:johnpdonaldson@yahoo.com] Sent: Monday, February 12, 2001 11:42 AM To: php-general@lists.php.net Subject: [PHP] character problem I've created a PHP script that is called from a form to send an email. The contents of the email is a hidden value in the form named "info," and is typically a paragraph of text. It works fine, however, for some reason, the apostrophy character always gets emailed looking like this: /' I've tried everything to get around this. Any ideas? Here's my script and form: Form: <form name="form1" method="GET" action="emailsender.php"> <p>Email this product info to a friend</p> <input type="text" name="email"> <input type="submit" name="Submit" value="Email Info"> <input type="hidden" name="info" value="This is the text that gets emailed. I'm having problems with the apostrophe character in this text though"> </form> Script file named emailsender.php: <?php print "<p>The product info has been mailed to: <b>$email</b>"; $to = $email; $sender ="info@challenger.org"; MAIL( "$email", # address to send $info email to "Product Info", # subject "$info", # hidden form field containing text to email "From: $sender\nX-Mailer: PHP/" . phpversion()); ?> Thanks in advance, John __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- 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 (#39230) next »