Pitaridis Aristotelis wrote:
I tried to make a login page, and store all the required information so that
the user will not be able to go directly to a non-authorized page, but the
whole idea was a failure. Does anybody know where I can find a script like
that?
Thanks in advance
Aristotelis
The html script that collects the data should include something
like:
<form action="goval.php" method="POST">
<table align="center" border="8" bgcolor=Silver>
<tr class="required">
<td class="lbl">Your Login ID:</td>
<td class="inp"><input type="text" name="ac" size="32"
maxlength="32"></td>
</tr>
<tr class="required">
<td class="lbl">Your Password </td>
<td class="inp"><input type="password" name="password" size="32"
maxlength="32"></td>
</tr>
</table>
<br><br>
<div align="center"> <input value="Sign in" type="submit">
</div>
</form>
Your php program (in this case named goval.php) should include:
//////////////////////////////
// Check for presence of valid input
$ac = $_POST['ac'];
$password = $_POST['password'];
if (empty($ac)) {
echo "goval - missing input parameters";
echo "ac: " . $_POST['ac'] . "<br>";
}
///////////////////////////////////
// operations using the variables that were passed in.
if ( $password == '' ) {
$password = change_password_function($ac);