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");
}
?>
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 PHP4 HTTP Compression Speeds up the Web Categories : PHP , Zlib , HTML and PHP , HTTP , Network Authentication HTTP protocol POST Categories : Authentication , HTTP , PHP Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate. Categories : Authentication , PHP How to let a user download a picture by clicking on it instead of needing to right click and Save-As. Categories : HTTP , PHP , HTML and PHP , Filesystem 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 that does language negotiation based on the Accept-Language header, a cookie or host name Categories : HTTP , PHP , Cookies Full membership authentication system. Categories : Authentication , MySQL , PHP , Databases what salt do I have to feed the crypt function with to make it work like the htpasswd command of apache? Categories : Algorithms , PHP , Authentication Script to check values being submitted by POST or GET method from a form. This script may help diagnose what variables are being supplied by a browser to other php scripts. Categories : HTML , Variables , Debugging , PHP , HTTP Using Postgres and PHP3 Authentication from a Web application Categories : PostgreSQL , HTML and PHP , Authentication , PHP Password protection for Phorum 3.1.x with userlevels and log. Categories : PHP , MySQL , Authentication , Security Produces browser-safe strings while preserving HTML tags. Categories : Strings , HTTP , PHP , HTML and 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