IP check

Gestart doorOne2xs6 reacties28 weergaven

7 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Bestaat er een script dat ik dit kan doen:
Als iemand uit het buitenland komt dan stuurt ie automatisch door naar index_engels.html
En als het nederlands IP is naar index_nederlands.html

Kan dit?
0
Berichten
364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja dit kan als je een automatische taalmachine van phphulp.nl kan opbouwen kan het lukken
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Maar hoe?
Ik heb hier geen verstand van yummie
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan met GeoIP volgens mij,
En anders maak je een Enter pagina, waar ze de taal kunnen kiezen?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jponsen:
Kan met GeoIP volgens mij,
En anders maak je een Enter pagina, waar ze de taal kunnen kiezen?

Ik vind het professioneler als het automatisch gaat yummieEdit: ik kan alleen een demo ofzo vinden van GeoIP,
Dus ik denk niet dat dat het is yummie
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik heb het yummieVoor de gene die het willen hebben:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// redirect script op grond van taalinstelling browser
// deze code is omwerking van info op
// http://www.webmasterworld.com/forum88/3779.htm
// (niet vergeten, indien je dit php bestand als utf8 upload
// dan zonder Byte Order Mark (BOM) anders werkt php header niet)[/COLOR]

[COLOR= #0000BB]$locatie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]english/index.php[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// default locatie
// check of $_SERVER["HTTP_ACCEPT_LANGUAGE"] er is[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"HTTP_ACCEPT_LANGUAGE"[/COLOR][COLOR= #007700]])) {[/COLOR]
    [COLOR= #FF8000]// string (bijv. nl, en-us, en) exploden[/COLOR]
    [COLOR= #0000BB]$talen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"HTTP_ACCEPT_LANGUAGE"[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #FF8000]//loop door de talen[/COLOR]
    [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$talen[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR]    
        [COLOR= #0000BB]$taal[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// alleen eerste 2 letters
        // indien taal hieronder erbij zit default locatie overschrijven[/COLOR]
        [URL="http://www.php.net/switch"]switch[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$taal[/COLOR][COLOR= #007700]) {
            case[/COLOR] [COLOR= #DD0000]"fr"[/COLOR][COLOR= #007700]:[/COLOR]
            [COLOR= #0000BB]$locatie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]francais/index.php[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/break"]break[/URL] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// break 2 om zowel de switch als foreach te verlaten[/COLOR]
            [COLOR= #007700]case[/COLOR] [COLOR= #DD0000]"de"[/COLOR][COLOR= #007700]:[/COLOR]
            [COLOR= #0000BB]$locatie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]deutsch/index.php[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/break"]break[/URL] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
            case[/COLOR] [COLOR= #DD0000]"nl"[/COLOR][COLOR= #007700]:[/COLOR]
            [COLOR= #0000BB]$locatie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]nederlands/index.php[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/break"]break[/URL] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
            case[/COLOR] [COLOR= #DD0000]"en"[/COLOR][COLOR= #007700]:[/COLOR]
            [COLOR= #0000BB]$locatie[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]english/index.php[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/break"]break[/URL] [COLOR= #0000BB]2[/COLOR][COLOR= #007700];
        }
    }
}[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: $locatie"[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// header schrijven[/COLOR]
?>
0
Berichten
46
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wilde ongeveer hetzelfde zeggen als de auteur boven mij yummie Maar zo is dus een mogelijkheid smile Eventueel kan je ook een WHOIS plegen opn IP-adres en kijken waarvan het vandaan komt. Nadeel is dat het wel weer snelheid kost.

Bovenste is dusn goeie oplossing thumbsup
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren