clankill3r Posted October 26, 2011 Share Posted October 26, 2011 I had some curl problems so i tried another function that a teacher mailed me once. However he did not test it, just said it is something like this. I was hoping for a error, instand i just go to the url where i want the data from, which line causes that? <?php include "lib.php"; $url = "http://www.doekewartena.nl"; $content = getFileContents($url); print_r2($content); ?> print_r2: function print_r2($val){ echo "<pre>"; print_r($val); echo "</pre>"; } getFileContents: function getFileContents($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, CURLREFERER); $data = curl_exec($ch); curl_close($ch); return $data; } Link to comment https://forums.phpfreaks.com/topic/249869-why-do-i-get-transfered-to-the-url/ Share on other sites More sharing options...
requinix Posted October 26, 2011 Share Posted October 26, 2011 Causes what? Link to comment https://forums.phpfreaks.com/topic/249869-why-do-i-get-transfered-to-the-url/#findComment-1282509 Share on other sites More sharing options...
jcbones Posted October 26, 2011 Share Posted October 26, 2011 I don't think you are actually being re-directed to the other site, but that it looks that way, because you are echo'ing the contents out to the browser. Link to comment https://forums.phpfreaks.com/topic/249869-why-do-i-get-transfered-to-the-url/#findComment-1282515 Share on other sites More sharing options...
clankill3r Posted October 27, 2011 Author Share Posted October 27, 2011 jcbones your right! Link to comment https://forums.phpfreaks.com/topic/249869-why-do-i-get-transfered-to-the-url/#findComment-1282804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.