Help: weird mysql_real_escape_string() problem
Posted: Thu Nov 18, 2004 11:48 am
Hi.
Got a weird problem and hope someone can help. I have installed PHP and Apache on my home pc and I have webspace also running php and apache.
PHP Version is 4.3.9 on both systems.
I'm working through a php tutorial and I have got to a section on form data and the function: mysql_real_escape_string()
But on my home systm mysql_real_escape_string() behviour is totally weird. It actually strips out +all+ characters from any string. So the following code:
will produce output (on my home system):
var is [hello]
var is []
and produces the expected output on remote system:
var is [hello]
var is [hello]
I have searched the net for anyone having similar problems and have found nothing. Can anyone shed any light on what is going on? I have tried this in IE 6 and Opera 7. I have tried both magic_quotes_gpc settings. I have checked the encoding of the pages. Just cannot figure it out. HELP!
Thanks for any help,
darrell.
I should have said: I'm running Windows XP Pro SP 2
Weirdan | Help us, help you. Please use
Got a weird problem and hope someone can help. I have installed PHP and Apache on my home pc and I have webspace also running php and apache.
PHP Version is 4.3.9 on both systems.
I'm working through a php tutorial and I have got to a section on form data and the function: mysql_real_escape_string()
But on my home systm mysql_real_escape_string() behviour is totally weird. It actually strips out +all+ characters from any string. So the following code:
Code: Select all
<?php
$var = "hello";
print "var is $var<br>";
$var = mysql_real_escape_string( $var );
print "var is $var<br>";
?>var is [hello]
var is []
and produces the expected output on remote system:
var is [hello]
var is [hello]
I have searched the net for anyone having similar problems and have found nothing. Can anyone shed any light on what is going on? I have tried this in IE 6 and Opera 7. I have tried both magic_quotes_gpc settings. I have checked the encoding of the pages. Just cannot figure it out. HELP!
Thanks for any help,
darrell.
I should have said: I'm running Windows XP Pro SP 2
Weirdan | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]