I have some data that can't contain certain character's, so I have
something akin to the following:

function getProper($string)
{
$string = strip_tags($string);
$string = str_replace("][","][",$string);
$string = str_replace("'","'",$string);
$string = str_replace("\"",""",$string);

return($string);
}

Now, I have page which submit's to page2.php, on page2.php I have a
foreach loop on the $_POST array, for each iteration it prints the hidden
input in HTML, but before that it passes each value through the above function.
Now, when I view source everything is as expected, I see "'" instead of
a single quote and everything, when I hit submit, and am now on page3.php,
I do: print_r($_POST) and all the values have been re-interpreted into there
original values (so instead of &#39, I see a single quote (in view-source to)) and
my DB queriy is failing because of this, I can get around this by moving my replace
step to the page with the DB query, but I was wondering is this a bug or expected
behavior? Maybe it's just me, but if PHP is doing this, I wouldn't think it should be
interpreting the values you pass back and forth at all, just pass them.

Thanks.
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to