RE: [PHP] Text boxes posted to MySQL record that contain quotes
lol why didnt i think of this , i have done this before for hidden form fields when creating a preview page :\ , i guess i have to reconvert if it reposts so it doesnt screw up the sql -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 8:49 PM To: Vernon Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Text boxes posted to MySQL record that contain quotes Vernon wrote: > I know that using stripslashes will remove \ using php but I'm having > trouble with posting quotation marks in a text record field. Anyone know how > I can get them to post to the database? It's basically like an email and I'd > like anything written to be able to post. Use htmlentities() to convert quotes to HTML entities. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com -- 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
Re: [PHP] Text boxes posted to MySQL record that contain quotes
Vernon wrote: I know that using stripslashes will remove \ using php but I'm having trouble with posting quotation marks in a text record field. Anyone know how I can get them to post to the database? It's basically like an email and I'd like anything written to be able to post. Use htmlentities() to convert quotes to HTML entities. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text boxes posted to MySQL record that contain quotes
"Vernon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > OK when I use the mysql_escape_string() it adds the slashes so that the > message will have \"the message\" so I've tried using the stripslashes() as > such: > > $message = > stripslashes(mysql_escape_string($HTTP_POST_VARS['message'])); > > which then causes the orginal problem, so it seems that I keep trying to > reverse each other. > > I don't want the slashes and I need the quotes. Hi, this is from obscure memory, have a look at the function get_magic_quotes_gpc. I think that the input you are getting is already escaped. HTH G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text boxes posted to MySQL record that contain quotes
OK when I use the mysql_escape_string() it adds the slashes so that the message will have \"the message\" so I've tried using the stripslashes() as such: $message = stripslashes(mysql_escape_string($HTTP_POST_VARS['message'])); which then causes the orginal problem, so it seems that I keep trying to reverse each other. I don't want the slashes and I need the quotes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Text boxes posted to MySQL record that contain quotes
adding slashes doesnt work like i said all that will show up in the box is a slash \ Try mysql_escape_string() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text boxes posted to MySQL record that contain quotes
On Wednesday, July 9, 2003, 5:50:05 AM, Vernon wrote: V> I know that using stripslashes will remove \ using php but I'm having V> trouble with posting quotation marks in a text record field. Anyone know how V> I can get them to post to the database? It's basically like an email and I'd V> like anything written to be able to post. Try mysql_escape_string() -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Text boxes posted to MySQL record that contain quotes
apologies i hope it didnt look like i just hijacked the thread i was just adding to it, this is a pretty serious issue though i dont think i've ever come across it before funny enough as most the quoted text is in the textarea instead , the quik fix i've done is to remove the quotes altogether but that just defeats the purpose. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Text boxes posted to MySQL record that contain quotes
wow i've had this issue aswell only yesterday , like in my search page of the project i've just done i stored the search values of each option so that they can return bak to the search page and edit their search entry , anyway the fulltext search text input can contain quotes denoting exact phrase , this breaks in the textbox in fact even with addslashes like so \"some text\" it will show up in the text input box like so \ , how do we get around this ? -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 12:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Text boxes posted to MySQL record that contain quotes I know that using stripslashes will remove \ using php but I'm having trouble with posting quotation marks in a text record field. Anyone know how I can get them to post to the database? It's basically like an email and I'd like anything written to be able to post. Thanks -- 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
[PHP] Text boxes posted to MySQL record that contain quotes
I know that using stripslashes will remove \ using php but I'm having trouble with posting quotation marks in a text record field. Anyone know how I can get them to post to the database? It's basically like an email and I'd like anything written to be able to post. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php