The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Asking how to add HTML Page password

3 posters

Go down

Solved Asking how to add HTML Page password

Post by haxxor 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
haxxor
Forumember

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

View user profile

Back to top Go down

Solved Re: Asking how to add HTML Page password

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

View user profile

Back to top Go down

Solved Re: Asking how to add HTML Page password

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

Thx guys :> solved!
haxxor
haxxor
Forumember

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

View user profile

Back to top Go down

Solved Re: Asking how to add HTML Page password

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

haxxor wrote:Thx guys :> solved!

Topic Solved & Locked






Asking how to add HTML Page password Slgray10

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

Male Posts : 50441
Reputation : 3478
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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