I'm stumped. Am writing a password scheme where if
the password is incorrect, a message is echoed to the
screen and if the password is correct, 'else if' takes
you to another .php file. Does anyone have any
pointers on making this work? Am including the code
below. Again, if the password is correct, it takes
you to "attendance.php" otherwise the error echoes to
the screen.
thanks for any replies, Chris
<?php
//create short names for variables
@ $name = $_POST['name'];
@ $password = $_POST['password'];
if(empty($name)||empty($password))
{
//Visitor needs to enter a name and password
?>
<h1>Please Log In</h1>
This page is secret.
<form method="post" action="secretest.php">
<table border="1">
<tr>
<th> Username </th>
<td> <input type="text" name="name"> </td>
</tr>
<tr>
<th> Password </th>
<td> <input type="password" name="password">
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Log In">
</td>
</tr>
</table>
</form>
<?php
}
else if($name=='user'&&$password=='pass')
{
// visitor's name and password combination are
correct
echo("<form method='post'
action='attendance.php'>");
}
else
{
// visitor's name and password combination are not
correct
echo '<h1>Sorry!</h1>';
echo 'You are not authorized to view this
resource.';
}
?>
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hq1bqtf/M=362329.6886308.7839368.1510227/D=groups/S=1705375618:TM/Y=YAHOO/EXP=1122747534/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/