|
|
|
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");
}
?> |
|
| 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 | | | 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 | | | Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate. Categories : Authentication, PHP | | | Basic Authentication with sessions Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions | | | The following snippet gives complete info about all submitted
HTTP_POST_VARS and HTTP_GET_VARS Categories : Variables, HTTP, PHP | | | Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip Categories : Email, Network, PHP, PHP Classes | | | PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character. Categories : PHP, Algorithms, Security, Authentication, Encryption | | | Complete, simple working example of login screen and check on a unique page using php functions, cookies and mysql database. Categories : PHP, Cookies, MySQL, HTML and PHP, Authentication | | | Function to remember password Categories : PHP, Authentication, Personalization and Membership | | | PHP4 MYSQL Authentication Script with cookie. Short & Sweet
Categories : Authentication, Apache, Cookies, PHP, MySQL | | | Is there some possibility to link a database to an htaccess file, so that instead of having a passwd file you would have a database with DES-crypted password and username fields? Categories : Authentication, PHP, General SQL, Databases | | | Authorize Me! An authentication script. Categories : MySQL, Databases, Authentication, PHP | |
| | | | 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 !!
souizougun@hotmail.com
| |
|
|
|