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:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 11:42 AM
To: [EMAIL PROTECTED]
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 ="[EMAIL PROTECTED]";
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]