uk26 Posted September 19, 2010 Share Posted September 19, 2010 Hi, im trying to impliment some code on our website to offer a Telephone Call Back Service. the server is running PHP5 and i am having some issus with $handle = fopen("$url", "r"); $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); can someone please help Quote Link to comment https://forums.phpfreaks.com/topic/213825-php-code-help/ Share on other sites More sharing options...
ignace Posted September 19, 2010 Share Posted September 19, 2010 $contents = file_get_contents($url); Quote Link to comment https://forums.phpfreaks.com/topic/213825-php-code-help/#findComment-1112855 Share on other sites More sharing options...
uk26 Posted September 19, 2010 Author Share Posted September 19, 2010 Hi, are you sugesting that i change it from $handle = fopen("$url", "r"); $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); ?> to $handle = fopen("$url", "r"); $contents = ''; while (!feof($handle)) { $contents = file_get_contents($url); } fclose($handle); ?> as its still not working Quote Link to comment https://forums.phpfreaks.com/topic/213825-php-code-help/#findComment-1112857 Share on other sites More sharing options...
uk26 Posted September 19, 2010 Author Share Posted September 19, 2010 Here is my full code but still same problem <?php ini_set ('user_agent', $_SERVER['HTTP_USER_AGENT']); require ('config.php'); $number = $_POST["number"]; $url = "$host$port/PbxAPI.aspx?func=make_call&from=$ext&to=$number&pin=$ext_pin"; $handle = fopen("$url", "rb"); $contents = stream_get_contents($handle); fclose($handle); ?> Quote Link to comment https://forums.phpfreaks.com/topic/213825-php-code-help/#findComment-1112881 Share on other sites More sharing options...
ignace Posted September 20, 2010 Share Posted September 20, 2010 I meant that you replace: $handle = fopen("$url", "r"); $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); With $contents = file_get_contents($url); Quote Link to comment https://forums.phpfreaks.com/topic/213825-php-code-help/#findComment-1113174 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.