array variable index in that rare SimpleXML functions

MetCiceEncuMe

New Member
I have a label on a form select and I get that value with $ _POST like this:\[code\]$gallery = array($_POST['gallery']);\[/code\]and that value will put it here:\[code\]$image = $sitemap->gallery[$gallery]->addChild('image');\[/code\]the problem is giving me error is as follows:\[code\]Fatal error: Call to a member function addChild() on a non-object in\[/code\]I do not understand is that if I put a value directly asin me do it like so:\[code\]$gallery = 0;$Image = $sitemap->gallery[$gallery]->addChild('image');\[/code\]I do well, what happens is that I want the user to choose,Kind of strange as it may fix.
 
Back
Top