Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-04-2004, 05:06 AM
AjiNIMC's Avatar
WebProWorld Pro
 

Join Date: Aug 2004
Location: India
Posts: 268
AjiNIMC RepRank 0
Default php - curl - proxy ? help plz

Hi all,
I am trying to do some proxy stuff , I am able to retrieve the page but not able to catch the return , what I am doing is

Quote:
passthru("curl --proxy 195.115.142.120:80 xyz.com");

or

exec("curl --proxy 195.115.142.120:80 xyz.com");
It throws the results (displays the xyz.com) to my page but I want to catch that in a variable like

$variable=passthru("curl --proxy 195.115.142.120:80 xyz.com");
or
$variable=(some php fucntion)("curl --proxy 195.115.142.120:80 xyz.com");

echo $variable ,

should give me the page.

Regards
AjiNIMC
Reply With Quote
  #2 (permalink)  
Old 10-04-2004, 08:12 AM
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 862
speed RepRank 1
Default

Code:
<?php

ob_start();
passthru("curl -s www.google.com");
$var = ob_get_contents();
ob_end_clean();

echo "-- START --\n\n$var\n\n-- END --\n";
?>
The variable $var holds the page data.
__________________
US & UK Web Hosting with hourly backups | Hosting Affiliate Scheme | Web Directory 2 for 1 Offer
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0