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; } Quote 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? Quote 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. Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.