views:

12

answers:

1

Hi Everyone,

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?

$question = "What is your name?";
$entry->addChild("Question")->addAttribute("text",$question);

WORKS!!!

$question = $_POST['question'];  // string from html form
$entry->addChild("Question")->addAttribute("text",$question);

DOES NOT WORK

A: 

Change your error_reporting level, you will see that the POST field doesn't exist.

error_reporting(-1);
$question = $_POST['question']; // fail
Josh Davis