justinh Posted December 11, 2008 Share Posted December 11, 2008 <?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 More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 echo htmlentities($result); Link to comment https://forums.phpfreaks.com/topic/136527-curl/#findComment-712673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.