how can i make an html application which accepts a password and opens a specific page...

ok firstly, create a database (mysql) :

Table:
Password char(100);
url char(200);

ok now create a form that recieves the password from the administrator:

<?php
include "authorize.php"; // COde to authorize the user.

if(isValidUser()) {
echo "<form action='url' method=post>";
echo "Password: <input type=password name=password value=''>";
echo "<input type=submit value=send name=submit>";
echo "</form>";
}
?>

now introduce the password form. asking for a single password. then you vertify

<?php
include "mysql.php"; // functions for connected to a mysql database.

$d= $_POST['password'];
$result = mysql_query("Select url from pages where password = '$password'", $db);

if($loc = mysql_fetch_object($result))
header("Location: $loc->url"); //path if it is valid.
else
header("Location: Login.php"); //Path if the password is invalid
?>

this would be helpful if you know some php and mysql.
 
technically you cant do that with JUST html, you should use javascript or php. heres how to do it with php

//Login page
<form method="post" action="process.php">
Input Password: <input type="text" id="p" name="p" />
<input type="submit" value="Go!" />
</form>

//Process.php page
<?php
$p = $_POST["p"];
header('Location: ');//Add a prefix/suffix to what the user typed here, use $p as what they typed
?>
 
Back
Top