Jump to content

curl


justinh

Recommended Posts

 
<?php

function getmyspaceinfo($myspaceid){


$ch = curl_init("http://www.myspace.com/".$myspaceid); // the target
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return the page
$result = curl_exec($ch); // executing the cURL
curl_close($ch); // Closing connection
echo $result;


}



if(isset($_GET['myspaceid'])){


getmyspaceinfo($_GET['myspaceid']);

}else{


echo "<html><head></head><Body><form method=\"GET\" action=".$_SERVER['PHP_SELF']."\"><fieldset><legend>Enter Myspace URL ID</legend><label for=\"myspaceid\">http://www.myspace.com/</label><input type=\"text\" name=\"myspaceid\"><input type=\"submit\" value=\"Get Source!\"></form>
</body></html>";

}

?>

 

i want to echo the page source instead of displaying the page.. any ideas?

 

 

Link to comment
https://forums.phpfreaks.com/topic/136527-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.