RE: [PHP] Char Problem

From: Date: Sat, 07 Apr 2001 19:22:46 +0000
Subject: RE: [PHP] Char Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47580@lists.php.net to get a copy of this message
> On my server I cant change anything on the php.ini.... is there any way how > to solve this problem in the code? No. This setting cannot be set within the script but can be with .htaccess with the following : php_flag magic_quotes_gpc off And be sure to have a look here (see user comments too) : http://www.php.net/manual/en/function.get-magic-quotes-gpc.php http://www.php.net/manual/en/configuration.php#ini.magic-quotes-gpc But, if you just want to strip the slashes before display it's common to use the stripslashes function : http://www.php.net/manual/en/function.stripslashes.php Which means in your case you can do : <?php echo stripslashes($text) ?> It'll print $text as desired. magic_quotes are on by default and are pretty common and useful, like for putting the data into the database (as it escapes \"stuff\" automagically!) Regards, Philip > > ----- Original Message ----- > From: ""Jack Dempsey"" <dempsejn@georgetown.edu> > Newsgroups: php.general > Sent: Saturday, April 07, 2001 8:48 PM > Subject: RE: [PHP] Char Problem > > > > look in your php.ini for the setting of magic_quotes > > if on, then php will automatically escape quotes for you once you've > > submitted data...you can turn it off, and then addslashes right before you > > enter your info into a database, or leave it on and stripslashes where > > appropriate..... > > > > -jack > > > > -----Original Message----- > > From: Mon Akira [mailto:MonAkira@gmx.de] > > Sent: Saturday, April 07, 2001 2:45 PM > > To: php-general@lists.php.net > > Subject: [PHP] Char Problem > > > > > > Hello... I have a problem with some special chars.... I created some kind > of > > editor for text files.... but chars like " get a \ in front everytime you > > send it.... here is my code: > > > > <form action="self.html" enctype="text/plain"> > > <textarea name="text" cols="80" rows="15" wrap=off> > > <?=$text?> > > </textarea><br> > > <INPUT TYPE="submit" VALUE="Send"> > > </form> > > > > If you just enter " and click send you see what my problem is.... does > > someone have a idea how to fix this??? > > Thanks! > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#47580) next »