PDA

View Full Version : A Script



RyanDOT
30-01-2009, 04:04 PM
that i can only view a page, but others get re-directed to the maintainace page..?

+Rep

Iszak
30-01-2009, 04:07 PM
I can think of two ways to do this but it relys on a static IP. You could make a script in PHP that checks your IP to the one set in the file if not redirect else show the page. Otherwise you can deny/allow certain ip's via the htaccess file. I'd presume the PHP script would be easiest.

Edit: The other way and most common is using a password that only you know again can be achieved by the simple authentication htaccess / htpasswd etc. files or by making a PHP script same condition applies, PHP would be easiest I'd presume.

Dentafrice
30-01-2009, 09:11 PM
If you want a simple, temporary, easy solution.. that doesn't require too much about security..

Just set a cookie on the page, load it up in your browser and let it set it.. then remove the set cookie code, and replace it with a simple script to check the cookie.

If the cookie doesn't exist.. redirect and exit, otherwise display the site.

You can put this in a config file and have it across the entire site. Simple.

Source
30-01-2009, 10:12 PM
Do an IP check, if its an IP for someone thats allowed in then load the page, else redirect? Slightly simpler than calebs idea but more of a pain if people have dynamic IPs.

RyanDOT
31-01-2009, 08:59 AM
What about a password protect page?
And code for it?

Jahova
31-01-2009, 10:01 AM
You can do it via Cpanel.

RyanDOT
31-01-2009, 10:23 AM
You can do it via Cpanel.

I know that, but i get this error:


Warning:
Due to Frontpage Extensions currently being installed and enabled, password protected directories will not work. If you wish to use this feature instead of Frontpage, please disable the Frontpage extensions.

You can use Frontpage directly to create password protected directories just like you normally can here. Alternatively, you can disable frontpage extensions and still use Frontpage to publish the site design via Webdav or FTP.

Edit: Done now!

Want to hide these adverts? Register an account for free!