Questions tagged [get-headers]
90 questions
0
votes
2 answers
Check if swf url avaliable or not using php get_headers Content-Type
I'm trying to drop invalid URLs from my flash games site.
Here is my code:
function valid($URL1) {
$headers = get_headers($URL1);
$headers = substr($headers[8],38,5);//leaves only flash word
if ($headers=='flash')
return true; else return…

Salem
- 654
- 7
- 24
0
votes
1 answer
relative url not working for getheaders
here is this script which works just fine for absolute url in img src tag but if img src tag is having relative url it fails and give error
Warning: get_headers() [function.get-headers]: This function may only be used against URLs in
in first…

Priya
- 165
- 1
- 12
0
votes
1 answer
get_headers takes too much time for checking size of image
hi i am using below code to check the size of remote image .it works but it takes lot of time to check the size of image is there any bette rway to do

Priya
- 165
- 1
- 12
0
votes
2 answers
getting raw output in local wamp same code working fine in webserver
i have this script which is workign just fine in server but in local wamp it is giving error
i have fopen is on
Warning: get_headers(): This function may only be used against URLs in C:\wamp\www\url\test5.php on line 8

Priya
- 165
- 1
- 12
0
votes
1 answer
get_headers() Redirection limit reached, aborting. failed to open stream: Operation now in progress
trying to write a functional php script to detect charset retrieve web pages.
My script works, but if I enter get_headers () for webtrh.cz/66997-fakturace-ramci-dph?p=416206
get_headers(http://webtrh.cz/66997-fakturace-ramci-dph?p=416206);
the…
user240277
0
votes
1 answer
php checking if file exists on an external domain always returns 403 or 404
ive been struggling with this for days now.
I have a subdomain mapped to a subfolder within the parent domain.
i want to use images images from its parent domain
i can link to the images fine by using a standard href in an image tag linking to the…

Dizzy Bryan High
- 2,015
- 9
- 38
- 61
0
votes
2 answers
If function execute more than x seconds php
In my script i use this function:
function url_exists($url) {
if ((strpos($url, "http")) === false) $url = "http://" . $url;
if (is_array(@get_headers($url)))
return true;
else
return false;
}
How can i set the time limit of execute…

Grzegorz Zając
- 119
- 10
0
votes
3 answers
How to get headers with PHP before loading entire content/page/file?
Background info:
I'm collecting some URLs dynamically from various sources online.
I would like to get the URL's content if it's an HTML page or an image.
I do not want to load large files (like a download zip, pdf or
others) - just to realize that…

preyz
- 3,029
- 5
- 29
- 36
0
votes
1 answer
Promise response works with GET, but not with POST in XHR
I am trying to call a URL through XHR.post on the DOJO 1.8. I need catch the STATUS property and getHeader() from promise response, but the problem is, when I call my URL with POST I don't have any promise, and when I call with GET I have all…

Thiago C. S Ventura
- 2,448
- 1
- 29
- 43
0
votes
2 answers
Why is the PHP get_headers() Last-Modified different from the apache file info
I have an Apache directory listing of files on a remote server (in Australia/Adelaide +930) I have no control over. This server shows the correct last modified date of a file as: 14-Aug-2009 09:41
I have a PHP script on my US server to check the…

Peter Craig
- 7,101
- 19
- 59
- 74
-1
votes
1 answer
PHP get_headers() result distinguish
I use the function get_headers( $url).
If according to http://php.net/manual/en/language.types.boolean.php an e,pty string equates to false.
How can I distinguish between the function returning get_headers( $url) === false and a empty string?
Or in…

Peter Vogt
- 353
- 1
- 4
- 16
-1
votes
1 answer
Is it possible to check a site to see if it responds to an HTTPS request? (PHP)
I have a PHP function:
function http_protocol()
{
return ($_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';
}
However, when the domain I am originating from is only HTTP, and I want to dynamically link to a domain that is HTTPS, the conditional…

Tiffany
- 680
- 1
- 15
- 31
-1
votes
1 answer
How to get data from array to string php
Have problem with php array.
I'm trying to send get_headers() request with paths written into $variable array, answer I want to write into MySQL database, spent few hours already, but didn't find out how to do that. It returns only 1 result, but if…

cybersecuriosity.com
- 43
- 7
-2
votes
1 answer
How to get headers by curl like get_headers
i know this has been asked many many times before,but this time should be the last time because the solution should be universaland unique that anyone can use the code anywhere in the project.
So the question : How to get any website header using…

Lukáš Stříbrný
- 1
- 3
-2
votes
2 answers
PHP method of loading remotely stored files
I am using SmartFile to store user submitted files. To display image files on the site I could just link to them, but if the file is missing I have no option to display a default image instead. Or to prevent hot linking. Or to setup browser cache…

Ally
- 955
- 1
- 15
- 33