Skip to content

Instantly share code, notes, and snippets.

@andrewwatson
Created June 16, 2011 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewwatson/1029846 to your computer and use it in GitHub Desktop.
Save andrewwatson/1029846 to your computer and use it in GitHub Desktop.
SMS To Demo
<?php
header("Content-type: text/xml");
if ($_POST['Digits'] == "12345") {
$response = '
<Say>That is Correct</Say>
<Gather action="send.php" numDigits="10">
<Say>Type the number of the person to message</Say>
</Gather>
';
} else {
$response = '
<Say>That was incorrect.</Say>
<Redirect>step1.xml</Redirect>
';
}
?>
<Response>
<?php echo $response; ?>
</Response>
<?php
header("Content-type: text/xml");
$whoToSms = $_POST['Digits'];
?>
<Response>
<Say>Sending to <?php echo $whoToSms; ?></Say>
<Sms to="<?php echo $whoToSms; ?>">This is your message</Sms>
</Response>
<Response>
<Gather action="secret.php" numDigits="5" timeout="10">
<Say>Enter The Secret Code</Say>
</Gather>
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment