stripslashes();

Edward Dudlik
Becoming Digital
www.becomingdigital.com



----- Original Message ----- 
From: "James Johnson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, 10 October, 2003 13:07
Subject: [PHP] Echoing string with single quote from $_POST


Hi,

I'm building a form where a user can enter text. When the form is submitted
I'm doing some validation before continuing. If the form isn't filled
correctly, then the user has to correct it before continuing. However, I
want to save the data that has been entered (some of it may be lengthy), so
I'm doing this:

<input name="adTitle" type="text" id="adTitle" size="50" maxlength="50" 
value="<?php if(isset($_POST['adTitle'])){echo
$_POST['adTitle'];}?>">

If the $_POSTed string has quotes in it, the output contains a slash

"It's great" becomes "It\'s great" on the page.

I've tried echo addslashes($_POST['adTitle']);} and that doesn't work. Is
there another function that will output the string just as it was input?

I've searched through the manual and haven't found anything yet. Just
thought you all would know off the top of your head(s). :)

Thanks,

James

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to