You are writing PHP code for “SoSci Survey”. This is a restricted sandbox environment.
echo or print do NOT work as expected. Use html() to output text/HTML.$_POST, $_GET, $_SESSION are NOT available. Use value() to read data.fopen, file_get_contents are forbidden.put() or made global by using registerVariable().WRONG: $gender = $_POST['SD01'];
RIGHT: $gender = value('SD01');
if (value('SD01') == 2) { question('FU02'); // Show follow-up question }
WRONG: echo '<p>Paragraph</p>';
RIGHT: html('<p>Paragraph</p>');
Use %placeholder% syntax inside text elements and a matching replace() in previoud PHP.
replace('%name%', 'John Doe'); </code php> <code html> <p>The name is %name%</p>
Use debug($variable) to inspect values during questionnaire testing, start the questionnaire in debug mod (yellow play button).