Versio

Hoe een pagina redict detecteren

Overzicht Reageren

Bram Z

Bram Z

26/08/2005 20:41:00
Quote Anchor link
Ik zou graag weten hoe je kan weten met php als je een pagina hebt naar waar hij jou rederict,

Want als ik voorbeeld deze pagina na toegaa:
http://www.google.be/search?hl=nl&q=test&btnI=Ik+doe+een+gok

Zal hij in je browser naar het eerste google resultaat gaan, maar met php zal hij zeggen:

Warning: get_headers(http://www.google.be/search?hl=nl&q=test&btnI=Ik+doe+een+gok) [function.get-headers]: failed to open stream: HTTP request failed! „îkî|8‘|ÿÿÿÿ2‘|«‘|ë‘|:%|òk in c:\Server\public_html\test.php on line 4

Naar waar stuurde hij mij nu ??
 
PHP hulp

PHP hulp

24/05/2012 21:17:32
Gesponsorde koppelingen:
BHosted Hosting al vanaf € 1,- per maand

Controleer nu gratis jouw domeinnaam:

  
 
Jelmer rrrr

Jelmer rrrr

26/08/2005 21:08:00
Quote Anchor link
Ik krijg als resultaat:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
Array
(
    [
0] => HTTP/1.0 302 Found
    [Location] => http://www.123test.nl/
    [Cache-Control] => private
    [Set-Cookie] => PREF=ID=17187c792149af15:TM=1125083226:LM=1125083226:S=AW72L5K5VGSIWxXk; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.be
    [Content-Type] => Array
        (
            [
0] => text/html
            [1] => text/html
        )

    [
Server] => Array
        (
            [
0] => GWS/2.1
            [1] => Apache/2.0.46 (Red Hat)
        )

    [
Content-Length] => 152
    [Date] => Array
        (
            [
0] => Fri, 26 Aug 2005 19:07:06 GMT
            [1] => Fri, 26 Aug 2005 19:07:06 GMT
        )

    [
Connection] => Array
        (
            [
0] => Keep-Alive
            [1] => close
        )

    [
1] => HTTP/1.1 200 OK
    [X-Powered-By] => PHP/4.3.11
)
?>


Code:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
$url
= 'http://www.google.be/search?hl=nl&q=test&btnI=Ik+doe+een+gok';
print_r(get_headers($url, true));
?>


PHP5 op Apache 1.zoveel geloof ik, op Mac OS 10.4.2
 
Bram Z

Bram Z

26/08/2005 21:13:00
Quote Anchor link
Ja sorry twas mijn fout :(
 



Overzicht Reageren

Get Adobe Flash player