Cookbook.PDF by Unknown

Cookbook.PDF by Unknown

Author:Unknown
Language: fra
Format: epub
Tags: Informatique
Publisher: O'Reilly
Published: 0101-01-01T00:00:00+00:00


$url = $_SERVER['argv'][1];

// retrieve URL

$c = curl_init($url);

curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($c, CURLOPT_FOLLOWLOCATION,1);

$page = curl_exec($c);

$info = curl_getinfo($c);

curl_close($c);

// compute base url from url

// this doesn't pay attention to a <base> tag in the page

$url_parts = parse_url($info['url']);

if ('' == $url_parts['path']) { $url_parts['path'] = '/'; }

$base_path = preg_replace('<^(.*/)([^/]*)$>','\\1',$url_parts['path']);

$base_url = sprintf('%s://%s%s%s',

$url_parts['scheme'],

($url_parts['username'] || $url_parts['password']) ?

"$url_parts[username]:$url_parts[password]@" : '',

$url_parts['host'],

$url_parts['path']);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.