i have a form on a PHP page. All i trying to do is parse out some XML entered into that form (COMMAND) using simplexml_load_string
here is the test code:
<?php
if($_POST){
$Input = $_GET['COMMAND'];
$Data =<<<XML
<?xml version="1.0" encoding="ISO-8859-1"?> .
$Input .XML;
$xml = simplexml_load_string($Data);
var_dump($xml);
}
else
}
echo 'WTF!'
}
?>
<form id="form1" name="form1" method="post" action="index.php">
<textarea name="COMMAND" id="COMMAND" cols="45" rows="5">
<API>
<COMMAND>Test</COMMAND>
</API>
</textarea>
<input type="submit" name="button" id="button" value="Submit" />
</form>
this is the error i am receiving:
Parse error: syntax error, unexpected $end in /var/www/cgi/index.php on line 24
i think it has something to do with my weak attempt at concatenation.