homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

How do i change this fopen() to Curl?

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


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)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved