0

I need to execute a URL in back-end, when ever the page executes, for this I am using file_get_contents(); but sadly it is not processing the url requested, please help me, pardon me if I am wrong, thank you.

.PHP

<?php
$url="http://www.foo.in/bound/bound.php?phone_no=".$from_id."&api_key=xxxxxxxxxxxxxxxxxxxx &bound_version=2&extra_data=<response><dial record='true' limittime='1000' timeout='30' moh='default' >".$to_id."</dial></response>";
$data = file_get_contents($url);
?>
Aamir
  • 2,380
  • 3
  • 24
  • 54

1 Answers1

0

I resolved out the solution there was a gap in URL there was space after api_key and extra_data not encoded, btw thanks for support.

.PHP

$url="http://www.foo.in/bound/bound.php?phone_no=".$from_id."&api_key=xxxxxxxxxxxxxxxxxxxxx=2&extra_data=".urlencode("<response><dial record='true' limittime='1000' timeout='30' moh='default' >".$to_id."</dial></response>");

$data = file_get_contents($url);

echo $data;