Page 1 of 1

php download

Posted: Sat Jul 10, 2004 12:14 pm
by CerIs
I have this script for calculating the google pagerank, it works but it gives you the result in the form of a download, eg you get asked to download pr.php in your browser which isnt what i want. I can do basic php but its using functions ive never heard of. I think the last couple of lines are producing the output

Code: Select all

<?php
$url = 'info:'.$_GET['url'];
$ch = GoogleCH(strord($url));
$url='info:'.urlencode($_GET['url']);
$curl = curl_init("http://www.google.com/search?client=navclient-auto&ch=6$ch&ie=UTF-8&oe=UTF-8&features=Rank&q=$url");
curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; GoogleToolbar 2.0.110-big; Windows 2000 5.0)");
curl_exec($curl);
?>
essentially i just want to know what var the final value is in. ( Can post whole script if required ) Thanks for the help.

Posted: Sat Jul 10, 2004 12:38 pm
by kettle_drum
Try using sockets instead and then read the data you get and then print it to the screen.

Posted: Sat Jul 10, 2004 12:44 pm
by redmonkey
Assign the result from curl_exec to a variable then grep out the required info from that.

cURL is generally a far easier option than using sockets.

Posted: Sat Jul 10, 2004 8:53 pm
by feyd
you may want to add:
curl_setopt wrote:CURLOPT_RETURNTRANSFER: Pass a non-zero value if you want CURL to directly return the transfer instead of printing it out directly.