Jump to content

why do i get transfered to the url


clankill3r

Recommended Posts

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

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.