예제 #1
0
<?php

session_start();
require_once 'class/dataManager.php';
$dm = new dataManager();
if (!$dm->started()) {
    header('Location:nice-try.php');
}
if (isset($_POST['submit'])) {
    $dm->__construct();
    if ($dm->checkDuplicateUser($_POST['username'])) {
        $error_msg = "Username already exists!";
    } else {
        $res = $dm->registerUser($_POST['username'], $_POST['userpass'], $_POST['full_name'], $_POST['usercollege'], $_POST['useryear'], $_POST['useremail'], $_POST['usercontact'], 0);
        if ($res === 1) {
            $success = 1;
        } else {
            $error = 1;
        }
    }
}
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Innovacion Online Treasure Hunt">
    <meta name="author" content="Institute of Engineering & Management">