rawurlencode() different in php3 and php4 ?
| From: | Gianmarco Giovannelli | Date: | Sat, 23 Sep 2000 11:49:46 +0000 |
| Subject: | rawurlencode() different in php3 and php4 ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17333@lists.php.net to get a copy of this message | ||
First of all sorry if this message is arrived twice.
Hi everyone, I am using php4 (4.0.2) on FreeBSD and I found that the
function rawurlencode() acts differently from php3 (3.0.16)
Let me explain better:
<?php
if (!$string){
$string="SELECT * FROM TABLE WHERE ( tipo REGEXP '.*1.*') ORDER by
tipo";
}
echo "<a href=$PHP_SELF?string=".rawurlencode($string).">Click
here</a>";
echo "<P>".rawurlencode($string);
echo "<P>".$string;
?>
With php 3.0.16:
Click here
SELECT%20%2A%20FROM%20TABLE%20WHERE%20%28%20tipo%20REGEXP%20%27.%2A1.%2A%27%29%20ORDER%20by%20tipo
SELECT * FROM TABLE WHERE ( tipo REGEXP '.*1.*') ORDER by tipo
php4:
Click here
SELECT%20%2A%20FROM%20TABLE%20WHERE%20%28%20tipo%20REGEXP%20%5C%27.%2A1.%2A%5C%27%29%20ORDER%20by%20t
SELECT * FROM TABLE WHERE ( tipo REGEXP \'.*1.*\') ORDER by tipo
Obviusly mysql complain about an error in the SQL query (the \ are not
very friendly here :-)
Any idea ?
I'd like to use only php4 on that box, but if things remain in this way
I have to mantain also php3 mod.
Please cc. directly to me also, because I am not subscribed to the list.
Thanks everyone for attention...
--
Regards...
Gianmarco
"Unix expert since yesterday"
http://www.giovannelli.it