Jump to content
Sign in to follow this  
dave

Password value

Recommended Posts

Alright hers my delema: I'm building a password application to test my friends to see if they can crack the code. When they crack the code i want it to go to the second similar but harder application. I know some desent html and i'll show you the code i already have:

<html><body><body bgcolor="lightblue"><h1 align="center"> Daves Password challenge.<form>Password: <input type="password" name="password" <value="1jkh34k"> </form><form><input type="button" value="Enter Password"></form><form>

Thats the code i have but im not sure if i made the value for my password correctly. So if you can tell me were and how to input the href i would be thankful.

Share this post


Link to post
Share on other sites

Here's what it should look more like:

<form>Password: <input type="password" name="password" value="1jkh34k"> <input type="button" value="Enter Password"></form>

although, setting the value to something seems kinda weird... if you want to check what password they entered in the box, you have to use either javascript or php.

Share this post


Link to post
Share on other sites

Oops. I noticed that when i wrote value it was missinterperated. What i meant was how do i set the correct password so that when you hit 'Enter Password' it will take you to my other page.

Share this post


Link to post
Share on other sites

Here you go, if this is what you want.

<html><head><script type="text/javascript">var password="put the password here"var secondurl="put the second url's location here. Remember the 'http's!"var message="put the congratulations message here."function checkPass(){if(document.forms.myForm[0].value=password){alert(message)window.location=secondurl}else{alert("Sorry, you didn't guess it! Try again!")}}</script></head><body bgcolor="lightblue"><form name="myForm"><input type="password"><input type="button" value="Submit" onclick="checkPass()"></form></body></html>
The red parts are the parts that you can change.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...