php - $_GET Breaks XML -
i'm using simpleviewer flash image gallery on site, , uses xml file information images displays.
for site, need dynamically generate xml, i'm using php file text/xml content-type declared. however, reason when access 1 of variables in $_get array simpleviewer tells me there no images in gallery, though when view source looks exact same , well-formed.
here's code:
$photos = array( "1" => array("house1_1.jpg") ); foreach($photos[$_get["hid"]] $p){ echo ''; }
if replace $_get["hid"]
"1"
works fine, when make reference $_get returns error.
is there reason why accessing variable cause scripts linking xml (the simpleviewer flash) malfunction, , there way around this?
*note: "hid" variable 100% sure set "1", , there no php error. also, output looks same when use $_get["hid"] versus "1", difference simpleviewer script refuses see images there. also, stuff in empty quotes xml, don't know how appear in tags...
var dump of $photos , $_get, respectively:
array(1) { [1]=> array(1) { [0]=> string(12) "house1_1.jpg" } } array(1) { ["hid"]=> string(1) "1" }
i first check , make sure $_get["hid"] returning "1". if it's possible not returning "1" should throw error accessing bad index of $photos.
Comments
Post a Comment