Hi Kurt,
Just try to use the function addslashes().
$string = addslashes($string);
This function will set in front of each " and ' a .
If you select some data from the database you have then to use again stripslashes() to remove the \ in front of a ' or ".
$string = stripslashes($string);
But actually should the server make this automatically, but only if the webserver is configured correctly, i think!
php.ini:
magic_quotes_runtime = on|off
magic_quotes_gpc = on|off
.htaccess, httpd.conf:
php_flag magic_quotes_runtime on|off
php_flag magic_quotes_gpc on|off
Cyrill