SimpleXML addChild and addAttribute doesnt insert variables

Maksimov73

New Member
For some reason, my addChild and addAttribute functions only seem to work when I enter in direct strings. They don't work when I enter in a variable string that I received from a html form POST.Anyone know the reason why? \[code\]$question = "What is your name?";$entry->addChild("Question")->addAttribute("text",$question);\[/code\]WORKS!!!\[code\]$question = $_POST['question']; // string from html form$entry->addChild("Question")->addAttribute("text",$question);\[/code\]DOES NOT WORK
 
Back
Top