Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How do i change this fopen() to Curl?



1:55 pm on May 12, 2007 (gmt 0)

10+ Year Member


I use the below script that shows content from an affiliate address.
But due to security reasons i cant use fopen() anymore,but Curl instead.
Big question (for me) is,how do i change it in this code?
Any help please?..

$wi = 17176; // Uw affiliate website ID
$ws = WEBSITE_SUBID; // Uw affiliate SubID
// hieronder niets aanpassen
$domain = urlencode('http://'.$_SERVER['HTTP_HOST'].
$file = 'http://www.example.com/whitelabel.php?'
$fp = fopen($file, 'r');
while(true) {
$content = fread($fp, 8192);
if (strlen($content) == 0) break;
$data .= $content;
} fclose ($fp);
print $data;

This is all the code.

[edited by: jatar_k at 4:27 pm (utc) on May 12, 2007]
[edit reason] switched to example.com [/edit]


5:31 pm on May 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

it should be a straight forward cURL session. www.php.net/curl you can follow any example there to accomplish your task

Featured Threads

Hot Threads This Week

Hot Threads This Month