Re: addslashes()

From: Date: Thu, 07 Feb 2002 23:38:58 +0000
Subject: Re: addslashes()
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-16644@lists.php.net to get a copy of this message
Ahha, i see. Hmm well you can make your own addslashes function like this. Add the following line at the beginning of the php code function superaddslashes($input) { return ereg_replace ('"', '\"', $input); } Then you can do $Notes = superaddslashes($Notes); ----- Original Message ----- From: "Todd Williamsen" <todd@williamsen.net> To: <php-db@lists.php.net> Sent: Thursday, February 07, 2002 11:54 PM Subject: Re: [PHP-DB] addslashes() > Ok.. > > i tried it out... and it almost works like I want it... weird though > > 1. when I put in <p><font color="blue">this is > BLUE</p></font> > > it prints it in like a bright green. but if i use the RGB # then its fine. > weird.... > > 2. if there is an apostrophe in the notes, then it will add slashes it to > that as well > > so if I type blah blah blah I am going over to my friend's website later on > and here is the address... > > <a href="http://friends.com>Friends</a> > > it will look like > > friend\\\'s > > Friends(link) > > . > "Acealex" <alex@saers.com> wrote in message > news:002001c1b027$ec33b7b0$e4d22fc2@acealex... > > Try > > $Notes = addslashes($Notes); > > > > You where almost right :) > > > > /Alexander > > > > ----- Original Message ----- > > From: "Todd Williamsen" <todd@williamsen.net> > > To: <php-db@lists.php.net> > > Sent: Thursday, February 07, 2002 11:32 PM > > Subject: [PHP-DB] addslashes() > > > > > > > I have a "Notes" field where users can add notes. Now, there will be > > times > > > when they use quotes "" or maybe even HTML, what is the correct way of > > using > > > this function? > > > > > > I have tried: > > > > > > addslashes($Notes); > > > > > > and > > > > > > $Notes addslashes($Notes); > > > > > > neither work.. > > > > > > I thought I would ask this great newsgroup! > > > > > > Thanks > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#16644) next »