Hello,
I've got an issue that's driving me buggy. And, it seems so simple that either I'm doing something wrong or I've got some configuration settings improperly set.
Here's some short (pseudo) code samples:
<?php // THIS SCRIPT HANDLES THE FORM INPUT...
// Session is started...
$message = $_POST['message']; // Message = "Isn't this possible?"
// $message is validated...
$_SESSION['myVariable'] = $message;
// Another page is called because there's some problem with the form input...
?>
<?php // THIS SCRIPT RE-DISPLAYS THE FORM INPUT, ALLOWING USER TO EDIT...
// Session is started...
$message = $_SESSION['myVariable']; // Message SHOULD be = "Isn't this possible?"
echo "Message: {$message}<br />"; // Only displays "Message: <br />"...
?>
Basically, it seems that the apostrophe (or single quote) is causing the problem. It seems to cause the problem whether or not addslashes is performed prior to the assignment to the $_SESSION variable.
I have tried this several times by directly assigning a string value to a $_SESSION variable and then trying to display it in the next "screen". When I assign text that does NOT contain an apostrophe, it works. When I assign text that DOES contain an apostrophe, it does not work.
Am I doing something wrong here? What am I missing?
I'm running PHP 4.3.11 on Apache. I THINK it's around version 1.38, but havne't confirmed this yet. Zend Engine version 1.3 is running. magic_quotes_gpc is ON. :-(
Can anyone help? Let me know if you would like more information.
Thanks,
Travis