It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

form passwords

form passwords

Postby CourteousCat on Thu Mar 22, 2007 9:09 pm

Does anybody know a form code that would allow a website user to enter a password into a text field, click a submit button and if they supplied the right password; be directed to another page [main.htm]?

Thanks for you're helps!
CourteousCat
 
Posts: 11
Joined: Sun Mar 04, 2007 10:48 pm

Postby instinct46 on Tue Mar 27, 2007 2:00 pm

urm u need to be using php as well soz but here the code

--- main.htm

<HTML><HEAD><TITLE></TITLE></HEAD>

<BODY>
<FORM action="password.php" method="post">
Password: <INPUT name="password" />
</FORM>
</BODY>
</HTML>

--- password.php

<HTML>
<BODY>
<?php

$password = $_POST['password']

if ( $password == 'PasswordYouWant'){

echo "<a href=http://www.google.com>click here to be forwarded</a>";

}else
{
echo "YOU ENTERED THE WRONG PASSWORD!!";
}
?>
</BODY>
</HTML>

---

sorry bout not being able redirect but tht close to wat u want :/
User avatar
instinct46
50+ Club
 
Posts: 90
Joined: Tue Mar 27, 2007 1:07 pm
Location: St Helens, England

Postby kakarot_90 on Wed Mar 28, 2007 2:59 pm

for the text box
<INPUT type="text" size="18" name="Username" value="">


for the submit box
<INPUT type="submit" name="Submit" value="Submit">

i think u can link ur pages only after u publish them
kakarot_90
 
Posts: 9
Joined: Sun Mar 25, 2007 10:40 am


Who is online

Users browsing this forum: No registered users and 9 guests