|
|
Allow/disallow page access by remote users' ip address (or any other http variables).
I use this on "under construction" pages. It allows me to work on the page in place
but prevents any other hosts from accessing it.
Note: any header() must appear before any html.
<?php
if ( getenv("REMOTE_ADDR") != "10.0.0.1" ) {
header("Location: http://otherhosthere");
}
?> |
|
| PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | Authentication HTTP protocol POST Categories : Authentication, HTTP, PHP | | | HTTP Basic Authentication via POP3. Categories : Authentication, HTTP, Email, PHP | | | Simple Password example Categories : PHP, Authentication, Security, HTTP | | | WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW Categories : HTTP, Network, Apache, PHP, Web Servers | | | Check whether your referer is coming from your website or from someone
else's.
Very useful when you want to represent the data without your domain
name for internel link-mapping in some COUNTER. Categories : PHP, HTTP | | | Examines the user's computer for open Netbus (the trojan horse) port and reports the conclusion to the user. Categories : Network, PHP | | | Using php3 to upload files, uploading files, file uploads. Categories : PHP, Filesystem, HTTP | | | Access_user Class - an easy to use system for protecting pages and register users. Categories : PHP, Classes and Objects, Object Oriented, PHP Classes, Authentication | | | Authentication script to authenticate users in Active Directory through LDAP. Categories : LDAP, Authentication, Cookies, PHP | | | .htpassword manager for apache Categories : PHP, PHP Classes, Authentication, Apache | | | Implementing a Members ONLY area Categories : PHP, MySQL, Databases, Authentication | | | Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate. Categories : Authentication, PHP | | | PHP3 Authentication using MySQL (also has nice query_db() function to return an array of arrays from a MySQL query result). Categories : Authentication, MySQL, PHP | | | Sample usage of IPv6 and IPv4 with PHP Categories : PHP, PHP Classes, Network | |
| |
| | | | | Arnaud PONTONNIER wrote : 431
HELLO,
It`s a good program, but i need five seconds to see the
php3 before to be redirected !
How can i do ?
Thanks
Arnaud.
| | | | Boaz Yahav wrote : 433
Instead of using the header to redirect use a Meta Refresh TAG with time set to 5 seconds :
<meta http-equiv=refresh content="5; URL=http://otherhosthere">
berber
| | | | momo gunas wrote :451
I wonder how to have a file (txt) where we could put all unauthorized ip adresses.
The php script could compare remote users` ip address and existing ip adresses in the txt file and then allow.disallow access to the page !!
Thank you very much for your help !!
[email protected]
| |
|
|