My Twilio Journey thus far
So apparently, by default, asp tags are disabled on php, yet they are used in the Hello Monkey example, specifically in the handle key php. ASP tags were brought to my attention by Austin Storm & Dave on the forums, thanks. I reworked Hello Monkey 1.4 to work without them, and I thought I would post my end result. Some notes:
-I commented out the header line, it was throwing me header rewrite errors
-There was a leading space before my first <?php> which gave me th e[Xx][Mm]....' error, make sure there are no leading spaces, the same applis for the XML tag, make sure it is right after the closing ?> php tag.
Alternatively you can enable ASP tags in php.ini and take care of the other stuff and you're set, or just use the following outline for the key handle php
<?php // Array of callers we know $people = array( "4158675309"=>"Curious George", "4158675310"=>"Boots", "4158675311"=>"Virgil", "4158675312"=>"Marcel", );
$name = $people[$_REQUEST['Caller']]; if (!$name){ $name = 'Monkey'; }
#header('content-type: text/xml');
?><<??>?xml version="1.0" encoding="UTF-8"?>
<?php if ($_REQUEST['Digits'] == '1'): print '7089557858'; print 'The call failed or the remote party hung up. Goodbye.'; elseif ($_REQUEST['Digits'] == '2'): print 'Record your monkey howl after the tone.'; print ''; endif ?>