Last change
on this file since 58 was
58,
checked in by fpvanagthoven, 14 years ago
|
mainmenu.php tweaked for usability. When not logged in, the user gets redirected to index.php
|
File size:
1.7 KB
|
Rev | Line | |
---|
[47] | 1 | <?php |
---|
| 2 | require 'classes/master.php'; //should be at top of every page |
---|
[10] | 3 | |
---|
[47] | 4 | if (isset($_POST['register'])) { |
---|
| 5 | if ($_POST['username'] != null && $_POST['password'] != null) { |
---|
| 6 | $userDBI = new UserDatabaseInterface(); |
---|
| 7 | $user_exists = $userDBI->checkUserName($_POST['username']); |
---|
| 8 | if (!$user_exists) { |
---|
| 9 | $userDBI->addNewUser($_POST); |
---|
| 10 | } |
---|
| 11 | else |
---|
| 12 | echo "Username already exists, try something else"; |
---|
| 13 | } |
---|
| 14 | else |
---|
| 15 | echo "please fill in a username and password"; |
---|
[44] | 16 | } |
---|
[38] | 17 | ?> |
---|
| 18 | |
---|
[10] | 19 | <!DOCTYPE html> |
---|
| 20 | <html> |
---|
| 21 | <head> |
---|
| 22 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
| 23 | <title>Facilitator</title> |
---|
| 24 | <link rel="stylesheet" type="text/css" href="css/style.css" /> |
---|
[38] | 25 | <script type="text/javascript" src="js/menu.js"></script> |
---|
[10] | 26 | </head> |
---|
| 27 | <body> |
---|
| 28 | <div id="header"> |
---|
[47] | 29 | <?php new Logo(); ?> |
---|
| 30 | </div> |
---|
| 31 | |
---|
[10] | 32 | <div id="wrapper"> |
---|
[47] | 33 | |
---|
[10] | 34 | <div id="content"> |
---|
[58] | 35 | <div class="menu"> |
---|
[47] | 36 | <form action="mainmenu.php" method="POST"> |
---|
[48] | 37 | <h3>Username</h3> |
---|
[47] | 38 | <input type="text" name="username"><br /> |
---|
[48] | 39 | <h3>Password</h3> |
---|
[47] | 40 | <input type="password" name="password"><br/><br/><br/> |
---|
| 41 | <input type="submit" name="login" class="surveyButton bigSurveyButton" value="Log in"> |
---|
| 42 | </form> |
---|
| 43 | <form action="register.php" method="POST"> |
---|
| 44 | <input type="submit" name="register" class="surveyButton bigSurveyButton" value="Register"> |
---|
| 45 | </form> |
---|
[10] | 46 | </div> |
---|
| 47 | </div> |
---|
| 48 | </div> |
---|
| 49 | </body> |
---|
[47] | 50 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.