IP Script

Gestart doorJeffreyt16 reacties52 weergaven

17 berichten · pagina 1 van 2

Jeffreyt

Lid · Topicstarter

Berichten
2.105
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bestaat er een script waarbij je IPs in kan voeren zodat alleen die kunnen kijken? Hoe werkt dat dan? En mocht je dat kunnen maken meld het.
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maak een .htaccess bestandje aan met dit erin:

Deny from all
Allow from [IP]
Allow from [IP]
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Je kan het zo doen maar je kan het ook met php doen.
0
Jeffreyt

Lid · Topicstarter

Berichten
2.105
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hoe
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Kijk hieronder

[COLOR= #0000BB]<?php
$ip[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]192.000.000.000[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ip[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700]] <[/COLOR] [COLOR= #0000BB]$ip[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]50[/COLOR][COLOR= #007700]]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je hebt toegang.[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je hebt geen toegang.[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Dit zal wel niet werken, maar hier komt het wel op neer.
0
Jeffreyt

Lid · Topicstarter

Berichten
2.105
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stel hij werkt.. dan moet de pagina eronder?
0
Tom

Lid

Berichten
3.868
Reputatie
0
Punten
0,02
Lid sinds
Laatst gezien
Nee, dan moet de pagina bij waar nu dit staat: Je hebt toegang., maar dan zou ik de code aanpassen naar dit(dit is na de echo), dan moet dus waar nu Je hebt toegang staat de pagina:

?>
Je hebt toegang.
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700];[/COLOR]
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@ Tom; Wtf is dat voor een kutscript? confused
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Inderdaad, lijkt nergens op xd
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Erik schreef:
@ Tom; Wtf is dat voor een kutscript? confused
Een heeeeeeeeeeeeeeeeeeeeeeel erg kut script
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Precies emo Als je iemand iets wilt geven dan moet je ook iets goeds geven.
0
Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$ip[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                [COLOR= #DD0000]123.456.789.101[/COLOR][COLOR= #007700],[/COLOR]
                [COLOR= #DD0000]123.456.789.102[/COLOR][COLOR= #007700],[/COLOR]
                [COLOR= #DD0000]123.456.789.103[/COLOR][COLOR= #007700],[/COLOR]
                [COLOR= #DD0000]123.456.789.104[/COLOR][COLOR= #007700],
            );[/COLOR]
            
[COLOR= #0000BB]$ip[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]123.456.789.105[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// of net hoe je de ips in de array wil zetten[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$ip[/COLOR][COLOR= #007700]))
{[/COLOR]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U mag niet bekijken[/COLOR][COLOR= #007700];

}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]

?>

    Hier je scripts, die de IPs wel mogen bekijken
    
[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #007700]}[/COLOR]
?>


als het goed is werkt het biggrin
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Marijnnn: je kunt beter dit doen:

[COLOR= #0000BB]<?[/COLOR]php
[COLOR= #0000BB]$ip[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR]
                [COLOR= #DD0000]123.456.789.101[/COLOR][COLOR= #007700],[/COLOR]
                [COLOR= #DD0000]123.456.789.102[/COLOR][COLOR= #007700],[/COLOR]
                [COLOR= #DD0000]123.456.789.103[/COLOR][COLOR= #007700],[/COLOR]
                [COLOR= #DD0000]123.456.789.104[/COLOR][COLOR= #007700],
            );[/COLOR]
            
[COLOR= #0000BB]$ip[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]123.456.789.105[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// of net hoe je de ips in de array wil zetten[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$ip[/COLOR][COLOR= #007700])))[/COLOR]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]U mag niet bekijken[/COLOR][COLOR= #007700]);[/COLOR]
?>
    Hier je scripts, die de IPs wel mogen bekijken
0
Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik weet niet waarvoor hij het wil gebruiken, maar ik nam dus aan dat hij het in zijn template wilde gebruiken om zo paginas af te schermen en dan staat het niet zo mooi als de pagina afbreekt.
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waarom geen htaccess-based? sadley Werkt net zo goed
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