The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Asking how to add HTML Page password

View previous topic View next topic Go down

Solved Asking how to add HTML Page password

Post by haxxor on January 21st 2012, 8:15 pm

can i ask a code for making a HTML Page password? if its already posted please link it up over it here Smile


Last edited by haxxor on January 22nd 2012, 4:31 am; edited 1 time in total

haxxor
Forumember

Posts : 157
Reputation : 1
Language : English,Filipino,CSS,HTML/Javascript

Back to top Go down

Solved Re: Asking how to add HTML Page password

Post by LGforum on January 21st 2012, 11:40 pm

Javascript passwords are not secure at all. The only proper way to password protect a page is server-side.

Anyway, you can simulate a password through javascript by creating a prompt box.

Code:

<script>
if (prompt('Whats the password?','') != 'YOUR PASSWORD'){window.location="/" }<script>

What that short bit of javascript will do is pop up a box asking for the password, if they type it in right, then the page will continue to load, but if they don't it will redirect them to your home page.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: Asking how to add HTML Page password

Post by haxxor on January 22nd 2012, 4:29 am

Thx guys :> solved!

haxxor
Forumember

Posts : 157
Reputation : 1
Language : English,Filipino,CSS,HTML/Javascript

Back to top Go down

Solved Re: Asking how to add HTML Page password

Post by SLGray on January 22nd 2012, 4:35 am

@haxxor wrote:Thx guys :> solved!

Topic Solved & Locked






When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36751
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum