Jump to content

Help! _REQUEST in an array


dillondoyle

Recommended Posts

I am new to PHP and am really stuck. I need to POST a few variables and can't seem to get it to work (I'm using the Twillio REST API).

 

Here is where the data I need POSTed is generated:

 

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    printf("vanID: %s  FirstName: %s Phone: %s Called: %s", $row["vanID"], $row["FirstName"], $row["Phone"], $row["Called"]);

$response = $client->request("/$ApiVersion/Accounts/$AccountSid/Calls",
	"POST", array(
		"Caller" => $number,
		"Called" => $row["Phone"],
		"FirstName" => $row["FirstName"],
		"Url" => $url . 'callback.php?number=' . $_REQUEST['called'] . 'firstname=' . $_REQUEST['FirstName']
	));

if($response->IsError) {
	$err = urlencode($response->ErrorMessage);
	die;
}

}

 

 

It is then sent to the following:

 

<?php
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
    <Say>Hello <?php echo $_POST['FirstName'];?>!</Say>
    <Pause length="1"/>
    <Hangup/>
</Response>

 

Any ideas on why this isn't working? Like I said, I'm just learning PHP so it's probably a really simple solution! Thanks in advanced for any help!!

Link to comment
https://forums.phpfreaks.com/topic/207659-help-_request-in-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.