recording handover and PHP5
Posted: Wed Dec 19, 2007 10:30 am
little problem here.
it seems everything executes fine apart from the fact that the variable used to store the file seems to be empty.
where did this go wrong?
VXML:
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<record name="myrecording" beep="true">
<prompt>
Please record a message after the beep.
</prompt>
<filled>
You just recorded the following message:
<value expr="myrecording"/>
Lets save this.
<submit next="upload.php" method="post" namelist="myrecording"/>
</filled>
</record>
</form>
</vxml>
PHP (5):
<?
header('Cache-Control: no-cache');
// Post variables
$myrecording = $_POST[myrecording];
file_put_contents("test.wav" ,$myrecording);
//
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
echo "<vxml version=\"2.0\">";
echo "<form id=\"main\">";
echo "<block>";
echo "Thank you";
echo "</block>";
echo "</form>";
echo "</vxml>";
?>
it seems everything executes fine apart from the fact that the variable used to store the file seems to be empty.
where did this go wrong?
VXML:
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<record name="myrecording" beep="true">
<prompt>
Please record a message after the beep.
</prompt>
<filled>
You just recorded the following message:
<value expr="myrecording"/>
Lets save this.
<submit next="upload.php" method="post" namelist="myrecording"/>
</filled>
</record>
</form>
</vxml>
PHP (5):
<?
header('Cache-Control: no-cache');
// Post variables
$myrecording = $_POST[myrecording];
file_put_contents("test.wav" ,$myrecording);
//
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
echo "<vxml version=\"2.0\">";
echo "<form id=\"main\">";
echo "<block>";
echo "Thank you";
echo "</block>";
echo "</form>";
echo "</vxml>";
?>