Questions tagged [get-headers]
90 questions
0
votes
0 answers
Is get_headers() function overloading my Apache server?
$url = "https://www.sportsdirect.com/york-monks-cross-store-1099";
$context = stream_context_create( [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
]);
$headers =…

Arzath Az
- 1
- 1
0
votes
1 answer
Fastest way to check for remote file (image) existence
I've written a products syncing script between a local server running a merchant application and a remote web server hosting the store's eshop...
For the full sync option I need to sync about 5000+ products, with their images etc... Even with the…

Faye D.
- 833
- 1
- 3
- 16
0
votes
1 answer
PHP get_headers function always HTTP/1.1
The PHP get_headers function returns an array, eventually including a string like HTTP/1.1 200 OK. The URLs I pass to the function are https. For some reason the successful response of get_headers always has HTTP/1.1, but Firefox devtools - network…

Christoph Haider
- 3
- 1
0
votes
1 answer
Switch Between Multiple Headers in WordPress Theme
I am building a custom theme for WordPress. One thing I want to do is allow myself to switch the header from the edit page.
I know I can hard code in the header to switch based on the page ID or name, like this:

ImageMagician
- 27
- 5
0
votes
1 answer
Effective method to check whether a URL exists or not using PHP
I'm trying to validate Google indexed URLs for a given domain in real time to return the valid pages count. I tried using PHP get_headers() and curl method. But even for 50 URLs both methods are taking more than 1 minute.
Is there any other easy…

Jenz
- 8,280
- 7
- 44
- 77
0
votes
2 answers
is wordpress block some php function?
I've created a php file inside the root of my site (example.com/file.php):
$head = array_change_key_case(get_headers("https://example.com/somefile.zip", TRUE));
$filesize = $head['content-length'];
echo $filesize;
When I run the file, I get the…

sajjad
- 1
- 2
0
votes
0 answers
How can I get the last updated date of the website?
I tried to get last-modified from the webpage header using get_headers().
But I don't get result, and the code above says that
Warning:…

Kid
- 1,160
- 2
- 14
- 31
0
votes
3 answers
PHP get_headers causing white screen of death
I'm trying to test to see if a .flv video stream exists on my page before deciding if to display flowplayer or not. I thought i'd have a go at looking at the file headers to see if it was found or not (I dunno if this will actuatlly work)....using…

Dan Twining
- 640
- 4
- 17
- 30
0
votes
1 answer
Files included in wordpress header.php are not accessible of page templates even after calling get_header()
I am developing a custom wordpress template. I have a few page templates for the layout.I call get_header() and get_footer() at the top and bottom of my page templates respectively.
Now the issues is. I have used two or three require_once() in the…

Arun
- 3
- 4
0
votes
1 answer
cURL / PHP cant fetch this - but all browser can?
I cant acces this site with any of Bellow methods, the $url adress Works in all my browsers but, i just cant fetch data from that site.... how is that possible ? Not even the robots.txt ('https://www.natterer-modellbau.de/robots.txt) cant be…

Morten Pedersen
- 65
- 6
0
votes
1 answer
Need php get_headers() results assigned to individual variables
So i can display the response headers using
$url = 'http://example.com';
$headers = get_headers($url,0);
foreach ($headers as $header => $key) {
echo "$header: $key
\n"; And I get back all the…
\n"; And I get back all the…

Micha
- 383
- 3
- 14
0
votes
1 answer
Safe to rely CURLINFO_EFFECTIVE_URL instead of Location address?
When recursively expanding an URL, is it safe to rely on the URL result using curl_getinfo($ch, CURLINFO_EFFECTIVE_URL) other than the Location header (301/302 redirection)?
I found that the location URL might be relative, but the…

Itay Ganor
- 3,965
- 3
- 25
- 40
0
votes
1 answer
How to get read headers in node.js using body-parser?
I am tring to create a demo API server using node.js, express4 and body-parser. I am trying to secure it using some Api-Key which will have to be passed in the request header. However, I am not able to do it.
I…

Ayush Gupta
- 8,716
- 8
- 59
- 92
0
votes
0 answers
error: 'ListView_GetHeade' was not declared in this scope, but i include "commctrl.h" as i see on msdn page
hi i use c++ code blocks.
and i try to get the heade of a listview with ListView_GetHeade():
BOOL CALLBACK enumWindowsProc(HWND hwnd,LPARAM lParam)
{
int length = ::GetWindowTextLength( hwnd ); //get the length of handler title.
if( 0 ==…

רועי נוה
- 31
- 4
0
votes
1 answer
Is the HTTP status code always the first value in get_headers()?
Questions regarding the get_headers() php function:
The function presents the headers in an array - is there any set order as to which header goes first?
I noticed that the HTTP status code sent by the page goes first - is that always a given?

Mirian
- 9
- 7