Прошу вас, как и я, новичок в PHP.Извлечь значение PHP
Я использую Twilio для разработки приложения IVR и использую тег [record], чтобы сделать короткую запись имени someones.
Так page1.php выглядит примерно так:
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
<Say>Please state your name after the tone</Say>
<Record maxLength="20" finishOnKey="#" playBeep="true" action="page2.php" />
</Response>
Это нормально, и значение RecordingURL пропускается в page2.php, как это должно быть. Тем не менее, на странице2.php я попрошу пользователя ввести свой ссылочный номер и передать значение RecordingURL в page3.php.
page2.php
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$rec_url=$_REQUEST['RecordingUrl'];
?>
<Response>
<Gather timeout="7" finishOnKey="#" numDigits="3" action="page3.php?rec_url=<?php echo $_REQUEST['RecordingUrl']; ?>" method="POST">
<Say>Please now enter your reference number</Say>
</Gather>
</Response>
Page3.php
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$ref_no=$_REQUEST['Digits'];
$cli=$_REQUEST['From'];
$rec_url=$_GET['rec_url'];
$nodialled=$_REQUEST['To'];
?>
<Response>
<Say>Thank you. Goodbye.</Say>
</Response>
<?php
$ref_no=$_POST['Digits'];
$cli=$_POST['From'];
$recording_url=$_POST['rec_url'];
$nodialled=$_POST['To'];
$html="<br />";
file_put_contents("test.html", "CLI: $cli $html Number Dialled: $nodialled $html Reference: $ref_no $html Recording URL: $recording_url");
?>
Любые идеи?
Заранее спасибо
'голый со мной' ?? Я не раздеваюсь, я даже не знаю тебя! – Dale