Hello all,
Working on a webapp for my work and I have to send people from certain departments to pages that correspond to the department only. I have a standard login page with a dynamic drop down menu to select the department. None of the options in the drop down menu call to a database, rather it just reads the array embedded within. Upon hitting the login button it calls to a validation script which is where I would like the redirect to happen. Here is the login page.
HTML Code:
<table width="40%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><img src="images/logomain.jpg" width="327" height="59"></div></td>
</tr>
<tr>
<td><form action="validate.php" method="post" name="login" id="login">
<table width="40%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" class="style5">Username</td>
<td width="50%"><input name="user_name" type="text" id="user_name"></td>
</tr>
<tr>
<td class="style5">Password</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td><div align="left"><span class="style5">Position</span></div></td>
<td>
now onto the dynamic drop down
PHP Code:
<?
$category = array(
1=> "Agent",
2=> "Property Mgmt.",
3=> "Principal Broker",
4=> "General Admin",
5=> "System Admin",
);
$category = str_replace(" ", " ", $category);
echo '<SELECT name=category>';
foreach ($category as $key => $value)
{
echo '<OPTION value='.$value.'> '.$value.'';
}
echo '</select>';
?>
onto the rest of the form
HTML Code:
</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Login">
</div></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
and there we have it.
Now in the validate.php file I already have an include command to establish the database connection from a file called dbconnect.php located in a seperate directory for the whole app to call to when needed, so thats squared away. The table that stores the user and pass is simply called "users", with "id", "user_name", and "password" fields. I do a
PHP Code:
<?php
include 'globals/dbconnect.php';
mysql_query = 'SELECT * FROM users';
?>
while in validate.php, but now what????
