VisionIT
Feb 26th, 2006, 03:24 PM
[Resolved: You can't run stripslashes on an array can you! Told you it'd be something stupid ;)]
OK folks, I have a problem which is driving me crazy.
magic_quotes_gpc OFF
html =>
<input name="items[]" type="hidden" value="<?php echo $item[0]; ?>">
The above code is nested in a loop which cycles through a number of items in a session. The output HTML shows items[] as each respective value. When submitted, the PHP print_r($items) command shows each item correctly and adds them via an SQL injection loop to the database, which also works perfectly.
magic_quotes_gpc ON
html =>
<input name="items[]" type="hidden" value="<?php echo $item[0]; ?>">
Same as above, nested in the loop and output HTML is identical. When submitted, the print_r($items) command returns 'array', as if i've tried to echo the results... then the SQL fails for obvious reasons. Right then... (I thought) just loop through all GPC's and stripslashes which should have the same effect as disabling the line in PHP.ini.... but it simply will not work. It still shows 'array' instead of actually displaying the values. As soon as you disable m_q_gpc it works perfectly.
It's probably something stupid, but i'm blown if I can solve it.
Cheers (and it's good to be back :) )
OK folks, I have a problem which is driving me crazy.
magic_quotes_gpc OFF
html =>
<input name="items[]" type="hidden" value="<?php echo $item[0]; ?>">
The above code is nested in a loop which cycles through a number of items in a session. The output HTML shows items[] as each respective value. When submitted, the PHP print_r($items) command shows each item correctly and adds them via an SQL injection loop to the database, which also works perfectly.
magic_quotes_gpc ON
html =>
<input name="items[]" type="hidden" value="<?php echo $item[0]; ?>">
Same as above, nested in the loop and output HTML is identical. When submitted, the print_r($items) command returns 'array', as if i've tried to echo the results... then the SQL fails for obvious reasons. Right then... (I thought) just loop through all GPC's and stripslashes which should have the same effect as disabling the line in PHP.ini.... but it simply will not work. It still shows 'array' instead of actually displaying the values. As soon as you disable m_q_gpc it works perfectly.
It's probably something stupid, but i'm blown if I can solve it.
Cheers (and it's good to be back :) )