Questions tagged [get-headers]
90 questions
1
vote
1 answer
PHP How to check removed blog in blogspot?
I want to check blog status, active or removed.
Active blog:
http://novisadcats.blogspot.com/
Removed blog:
http://cityofangell.blogspot.com/
Removed blog, but available to register:
http://madhouseofporn.blogspot.com/
I am trying to use php…

Ajie Kurniyawan
- 393
- 2
- 18
1
vote
1 answer
PHP get_headers() fails with Pinterest
I'm currently working on a tool to integrates link of different social networks:
Facebook: https://www.facebook.com/jonathan.parentlevesque
Google plus: https://plus.google.com/+JonathanParentL%C3%A9vesque
Instagram:…

Jonathan Parent Lévesque
- 1,902
- 1
- 25
- 35
1
vote
1 answer
get_headers php function throwing error
I am trying to fetch meta titles and keywords from a URL.
I have list of URLs in excel sheet, using phpExcel library i first fetch URLs and the run in foreach loop. And write my results in new excel sheet
My code is as follows

Penny
- 824
- 1
- 14
- 31
1
vote
0 answers
get_headers does not give the good result
I'm trying to get the headers from several URL with get_headers().
It's working correctly for some URL but for others I receive HTTP/1.1 404 File Not Found as an answer but when I analyze it with a tool such as http://web-sniffer.net/ i see that…

bernardo
- 381
- 3
- 9
1
vote
2 answers
get_headers() not returning Content-Length element
Function get_headers() does not give an array with the same indexes when I make a change in domain. When and why does this occur?
I want Content-Length value for hundreds of domains. What changes do I need to make?

Penny
- 824
- 1
- 14
- 31
1
vote
1 answer
verify a website by uploading a file can be spoofed?
In my website i have a website verification process based on a file
The user has to upload in his root directory a empty file with a filename like this:
site-verification-$user_id.html
then my script use the php get_headers() function to check if…

ipel
- 1,326
- 1
- 18
- 43
1
vote
1 answer
Is it possible to use get_headers after hiding referrer?
I'm using this code to get HTTP response:
$url = "http://example.com/";
$headers = get_headers($url);
$header = substr($headers[0], 9, 3);
echo = $header;
which works great but I need to hide referrer so I am using http://href.li/ like so:
$url =…

Xperplay
- 289
- 1
- 3
- 14
1
vote
2 answers
php: get_headers Function Results Are Different
i using get_headers Function in PHP to request headers from website
in local server return arrays
put when use in my website Does not return arrays
examples for returns
in local server
Array
(
[0] => HTTP/1.1 301 Moved
[Server] => Array
…

Testr
- 13
- 3
1
vote
1 answer
file_get_contents, curl, get_headers, .. returns nothing
I'm trying to get the content of an external file (youtube json feed)
I first tried using file_get_contents() and curl.
None of them are giving me any response.
In php.ini allow_url_fopen is set to On. And I also tried turning off safe…

cloetensbrecht
- 203
- 3
- 5
1
vote
2 answers
Finding out whether a website returns 200
I was using the following code to check whether a link that a user provides really points to an existing website:
$headers=get_headers($imageurl);
if (strpos($headers[0], '200') === false) {
echo "not valid1";
exit;
}
As test, I use the img…

Dennis Hackethal
- 13,662
- 12
- 66
- 115
0
votes
4 answers
Check for key in array php
I am using get_headers() and I want to return the content length. In the array below content length is key number 9, however I find that the content length is not always key number 9. I'm not sure why it is not always the same key? How do I search…

Ben Paton
- 1,432
- 9
- 35
- 59
0
votes
2 answers
How to know if a local URI/URL exists?
Let's assume my URL is mysite.com/myuri. There are many methods the world knows, to know if a local uri myuri exists on my site mysite.com.
The easiest and the fastest method is:
$uri_exists = file_exists($_SERVER['DOCUMENT_ROOT']."/myuri").
The…

Tabrez Ahmed
- 2,830
- 6
- 31
- 48
0
votes
1 answer
Public URL is accessible from curl, while it gives error using get_headers and file_get_contents
My PHP version is 7.4 and I'm trying to download twitter images using its API. I use get_headers to get mime type and other information but it doesn't work.
Whereas if I use curl it works. The error I get is
Name or service not known in php shell…

Daniyal Ahmed
- 63
- 9
0
votes
0 answers
Take out the $headers variable from the function
I have a problem when I want to fetch the $header variabel to get the header response
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $u);
curl_setopt($ch,…
0
votes
0 answers
get_headers()["Content-Length"] returns array
So I was getting fatal errors when handling remote-site file sizes and was removing pieces of the code to find the culprit, which was get_headers. I then printed its value and it said it was an array rather than a string (or…

Edward
- 495
- 1
- 6
- 20