$newstring = addslashes($oldstring);
then, use $newstring for everything.... should work.
----- Original Message -----
From: "garman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 20, 2001 11:57 AM
Subject: [PHP] inserting free-form text with quotes to mysql
> I'm creating a specialized "suggestion box" type of web application in
> I'm using MySQL for data storage.
> Whenever I try to submit text that contains a double quote character ("),
> submission gets truncated at the first occurance of a double quote and
> Single quotes don't seem to be problematic.
> So if the user inputted the following text:
> hello " my suggestion for deals with improving the...
> then only "hello" would get put in the database, and everything from the
> double quote to the end of the input would be truncated.
> I've tried addslashes() and removeslashes() before the submit, but that
> doesn't seem to help.
> The input data actually gets POST'ed twice: once when the user submits his
> form. After he submits, I bring up a "verification" form, where I show
> the user submitted so he can check to make sure everything is accurate.
> the verification page, I call another php page to actually do the database
> writing. (Note, when I played with add/removeslashes(), I was doing so on
> last php page, i.e., where the database operation actually takes place).
> I've noticed that either PHP, my browser, or the webserver seem to add
> automatically because any quotes (single or double) or slashes are escaped
> with a slash on the verification page.
> Hopefully this is just something simple I'm overlooking :)
> 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]