source: Dev/trunk/index.php @ 59

Last change on this file since 59 was 59, checked in by fpvanagthoven, 14 years ago

Absolutely had to do something about styling. Also some other things.

File size: 1.6 KB
Line 
1<?php
2require 'classes/master.php'; //should be at top of every page
3
4if (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";
16}
17?>
18
19<!DOCTYPE html>
20<html>
21    <head>
22        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
23        <title>Facilitator</title>
24        <?php new StyleSheet(); ?>
25        <script type="text/javascript" src="js/menu.js"></script>
26    </head>
27    <body>
28        <div id="header">
29<?php new Logo(); ?>
30        </div>
31
32        <div id="wrapper">
33
34            <div id="content">
35                <div class="menu">
36                    <form action="mainmenu.php" method="POST">
37                        <h3>Username</h3>
38                        <input type="text" name="username"><br />
39                        <h3>Password</h3>
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>
46                </div>
47            </div>
48        </div>
49    </body>
50</html>
Note: See TracBrowser for help on using the repository browser.