iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar 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.

Share Thread: & Tags

Share Thread:

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: 279
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
__________________
Be web educated - Client education series - Let not your SEO company cheat you. When they screw your website, they lose one client and you everything.
Reply With Quote
  #2 (permalink)  
Old 10-04-2004, 08:12 AM
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 972
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.
Reply With Quote
Reply

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

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

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



All times are GMT -4. The time now is 04:02 PM.



Search Engine Optimization by vBSEO 3.3.0