Page 1 of 1

Error with placing quotes on the screen

Posted: Mon Apr 30, 2007 1:19 pm
by anonymous2007
Does anybody here know the solution to the following problem?
By means of a php script I retrieve data from a mysql database and then place the data on the screen. However sometimes the ' and " are placed incorrectly on the screen as \' and \" and other times these characters are placed on the screen correctly as a ' en ". So when I reload the page from the webserver via internet in the browser this sometimes goes correctly and other times goes incorrectly. When I execute the same script locally on my own computer the above mentioned error does not occur. The webserver uses mysql 5.0.27 en php 4.0.6. Locally on my own computer I use php 4.0.5, mysql 3.23.32 and apache 1.3.14.
I've also tried the stripslashes() function but with no success.

Re: Error with placing quotes on the screen

Posted: Mon Apr 30, 2007 2:42 pm
by volka
anonymous2007 wrote:So when I reload the page from the webserver via internet in the browser this sometimes goes correctly and other times goes incorrectly.
That's the spooky part. Please try

Code: Select all

foreach(array('magic_quotes_gpc','magic_quotes_runtime','magic_quotes_sybase') as $p) {
	echo 'debug: ', $p, '=', ini_get($p) ? 'on':'off', "<br />\n";
}
anyway.

Posted: Tue May 01, 2007 3:01 am
by anonymous2007
This is the result:

debug: magic_quotes_gpc=on
debug: magic_quotes_runtime=off
debug: magic_quotes_sybase=off

Posted: Tue May 01, 2007 3:26 am
by anonymous2007
This seems to solve the problem:

set_magic_quotes_runtime(0);