Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "phpincludes/config.php";
- // If they are logged in, forward to main.php
- if($student->logged_in()) {
- redirectTo("main.php");
- }
- // Form Submitted?
- if(isset($_POST["submit"])){
- $account_type = get_request('account_type');
- $username = get_request('username');
- $password = get_request('password');
- // It's setup to handle multiple account types. Let's just assume student is the only one
- switch($account_type) {
- case 'student':
- $u = new Student;
- $u->auth($_POST['username'], $_POST['password']);
- redirectTo("main.php");
- break;
- }
- }
- siteheader("Flight 1", "Welcome");
- ?>
- <div id="main">
- <h3>Please Login</h3>
- <form action="index.php" method="post">
- <p><label>Account Type: </label>
- <select name="account_type">
- <option value="student">Student</option>
- <option value="instructor">Instructor</option>
- <option value="admin">Admin</option>
- </select>
- </p>
- <p><label for="username">Username :</label><input type="text" name="username" placeholder="Username"/></p>
- <p><label for="password">Password :</label><input type="text" name="password" placeholder="Password"/></p>
- <input type="submit" value="Submit" name="submit" />
- </form>
- </div>
- <?php
- sitefooter();
- ?>
Add Comment
Please, Sign In to add comment