I posted a question about this problem in the mysql forum yetersday, but after more experimentation I don't think it is related to mysql.
Problem: magic_quotes_gpc is on, but escape characters are not inserted. Maybe I do not understand how/when magic_quotes_gpc works.
Example Code
File 1 - registration.php
<? ini_set ("magic_quotes_gpc", 1); ?>
<form onSubmit="return validate(this)" action="contact.php" method="post">
<input type="text" name="lastName">
<textarea name="sourceText" >
<input type="submit" value="Submit">
</form>
File 2 - contact.php
<?
echo get_magic_quotes_gpc();
echo $sourceText;
echo addslashes($sourceText);
echo $lastName;
echo addslashes($lastName);
echo $HTTP_POST_VARS['sourceText'];
echo $HTTP_POST_VARS['lastName'];
?>
If
lastName is entered - O'Neil
and
sourceText entered - I don't understand.
contact.php produces the following result:
1
I don't understand.
I don\'t understand.
O'Neil
O\'Neil
I don't understand.
O'Neil
Any help much appreciated,
Cathy