Problem with single quot
| From: | afan pasalic | Date: | Wed, 16 Aug 2000 00:32:36 +0000 |
| Subject: | Problem with single quot | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1821@lists.php.net to get a copy of this message | ||
Thast's right, but I need something else: Why I'm getting print (in code
below) after submitting apostrophe with slash?!?
I have to compare string but with \' insteed ' - I'm getting error. Why and
what it's going on and how to fix it!
<?php
if($submit)
{
echo "$Query";
}
else
{
echo "<form method=\"post\" action=\"test.php3\">";
$values = "I'm working. It's hard";
echo "<input type=\"text\" name=\"Query\"
value=\"$values\"><br>";
echo "<input type=\"Submit\" name=\"submit\"
value=\"Submit\">";
echo "</form>";
}
?>
----- Original Message -----
From: "Gilles Tran" <tran@inapg.inra.fr>
To: "afan pasalic" <afan@sprout.net>
Sent: Tuesday, August 15, 2000 3:56 AM
Subject: Re: [PHP-WIN] Problem with inserting single quot
> At 11:06 15/08/00 -1200, you wrote:
> >Thank you G. for your very fast answer. But, I'm beginner in PHP and can
you
> >be a little bit more specific?
>
> I'm a beginner too... The addslashes function adds slashes before any
> character that needs it.
> For instance :
> $query="SELECT * FROM $feedtable WHERE FEED_NAME LIKE
> '%".addslashes($name)."%' ORDER BY FEED_NAME";
>
> Needless to say, it's very practical. There are many functions like this,
> under the chapter "string functions" in the manual, and I'm still learning
> to use a few of them.
>
> I hope this helps
>
> G.
> ===================================================
> io - La Banque de Donnees de l'Alimentation Animale
> 16 rue Claude Bernard 75231 PARIS Cedex 05 FRANCE
> Tel 01 44 08 18 08 / 33 1 44 08 18 08
> Fax 01 44 08 18 53 / 33 1 44 08 18 53
> E-mail : tran@inapg.inra.fr
> Web : http://www.inapg.inra.fr/dsa/iobdaa/iobdaa.htm
>
>