diff options
| author | root | 2014-11-10 12:49:35 +0100 |
|---|---|---|
| committer | root | 2014-11-10 12:49:35 +0100 |
| commit | 72a3cc39d5e629562be36758173afc99efb62af3 (patch) | |
| tree | 5f01a81bca5f1f4bd8c44c6b0823bbe9de58a665 /function.php | |
| parent | 771f805803f0cd67730ebbc7cb63e2312e4ca6c8 (diff) | |
| download | httpheader-72a3cc39d5e629562be36758173afc99efb62af3.tar.gz | |
v0.1
Diffstat (limited to 'function.php')
| -rw-r--r-- | function.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/function.php b/function.php index 9d957a5..87ec766 100644 --- a/function.php +++ b/function.php @@ -1,9 +1,12 @@ <?php function getHeader($url){ + $agent = "Retrieve HTTP headers online. v0.1"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_USERAGENT, $agent); $response = curl_exec($ch); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); |
