error on line 46 at column 3: Extra content at the end of th
Posted: Tue Mar 30, 2010 9:34 am
error on line 46 at column 3: Extra content at the end of the document
<?php
require "twilio.php";
/* Twilio REST API version */
$ApiVersion = "2008-08-01";
/* Set our AccountSid and AuthToken */
$AccountSid = "AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";
/* Outgoing Caller ID you have previously validated with Twilio */
$number = "NNNNNNNNNN";
/* Outgoing Number you wish to call */
$outgoing = "MMMMMMMMMM";
/* Directory location for callback.php file (for use in REST URL)*/
$url = "http://www.example.com/clicktocall/";
/* Instantiate a new Twilio Rest Client */
$client = new TwilioRestClient($AccountSid, $AuthToken);
if (!isset($_REQUEST["called"])) {
$err = urlencode("Must specify your phone number");
header("Location: index.php?msg=$err");
die;
}
/* make Twilio REST request to initiate outgoing call */
$response = $client->request("/$ApiVersion/Accounts/$AccountSid/Calls",
"POST", array(
"Caller" => $number,
"Called" => $outgoing,
"Url" => $url . "callback.php?number=" . $_REQUEST["called"]
));
if($response->IsError) {
$err = urlencode($response->ErrorMessage);
header("Location: index.php?msg=$err");
die;
}
/* redirect back to the main page with CallSid */
$msg = urlencode("Connecting... ".$_REQUEST["called"]);
header("Location: index.php?msg=$msg");
?>
<?php
require "twilio.php";
/* Twilio REST API version */
$ApiVersion = "2008-08-01";
/* Set our AccountSid and AuthToken */
$AccountSid = "AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";
/* Outgoing Caller ID you have previously validated with Twilio */
$number = "NNNNNNNNNN";
/* Outgoing Number you wish to call */
$outgoing = "MMMMMMMMMM";
/* Directory location for callback.php file (for use in REST URL)*/
$url = "http://www.example.com/clicktocall/";
/* Instantiate a new Twilio Rest Client */
$client = new TwilioRestClient($AccountSid, $AuthToken);
if (!isset($_REQUEST["called"])) {
$err = urlencode("Must specify your phone number");
header("Location: index.php?msg=$err");
die;
}
/* make Twilio REST request to initiate outgoing call */
$response = $client->request("/$ApiVersion/Accounts/$AccountSid/Calls",
"POST", array(
"Caller" => $number,
"Called" => $outgoing,
"Url" => $url . "callback.php?number=" . $_REQUEST["called"]
));
if($response->IsError) {
$err = urlencode($response->ErrorMessage);
header("Location: index.php?msg=$err");
die;
}
/* redirect back to the main page with CallSid */
$msg = urlencode("Connecting... ".$_REQUEST["called"]);
header("Location: index.php?msg=$msg");
?>