Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001071

Re: [PHP-DB] adding Carrol O'Conner in a form From: Dobromir Velev (diadomraz <email protected>)
Date: 07/02/01

Hi,
The slash is added because you have magic_quotes_gpc() turned on in your php
configuration file - when magic_quotes are on, all ' (single-quote), "
(double quote), \ (backslash) and NUL's are escaped with a backslash
automatically.
You can turn this configuration directive off or you can use stripslahes()
to remove the slashes.

Dobromir Velev

-----Original Message-----
From: Ken Sommers <mrsql.php <email protected>>
To: php-db <email protected> <php-db <email protected>>
Date: Sunday, July 01, 2001 7:22 AM
Subject: [PHP-DB] adding Carrol O'Conner in a form

HI,
IF i add my name as Carol O'Conner in a form and Echo (PHP 4.06 on win 95)
it back I see

Carol O\'Conner

If I pass that name along to another page I'll see it as:

Carol O\\\'Conner

Even if I use : <?php echo(htmlspecialchars ($name, ENT_QUOTES)); ?>

IF I enter my name as: Carol O'Conner <died>
I'll see it echoed as

Carol O\'Conner <died>

so I am thrilled that the <> came back and was displayed as it was typed in
by the user

but how do I get rid of that pesky slash \ ?

so I can echo exactly what the user typed in?

I am already using:

<?php echo(htmlspecialchars ($name, ENT_QUOTES)); ?>

Thanks for the help,

ken

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>