Beispiel #1
0
<?php

require $_SERVER['DOCUMENT_ROOT'] . "/resources/scripts/initialize.php";
gtIncludeOnce('constants.php');
global $PRESIDENT, $VICE_PRESIDENT, $TREASURER, $SECRETARY, $WEB_MASTER;
?>

<!DOCTYPE html>

<html>
<head>
	<title>Login</title>
	<?php 
gtInclude("includes/head.php");
?>
</head>
<body>
<div id="main">
	<?php 
gtInclude("includes/top.php");
?>
	<div id="content" class="primaryFGColor contentBox">
		<p>
			GTLoL is a legitimate League of Legends club at Georgia Tech.
			We have meetings and host tournaments (both online and on campus).
		</p>
		<h2>Leaders</h2>
		<p>
			President: <?php 
print $PRESIDENT;
?>
Beispiel #2
0
<?php

//TODO populate username field with username from login.php or the form in top.php
require $_SERVER['DOCUMENT_ROOT'] . "/resources/scripts/initialize.php";
gtIncludeOnce('scripts/requireNoLogin.php');
/// adds style="display:inline" if necessary
function addVisibleStyle($errName, $errs)
{
    if (isset($errs[$errName]) && $errs[$errName] == true) {
        print 'style="display:inline"';
    }
}
/// adds the initial value of a form if necessary
function addOriginalValue($name)
{
    if (isset($_POST[$name])) {
        print "value='{$_POST[$name]}'";
    }
}
//main code
$errors = array(0);
if (isset($_POST['btnRegister'])) {
    extract($_POST);
    $result = UserController::registerUser($newUsername, $newPassword, $retypePassword, $email, $retypeEmail);
    //array if errors; true if successful
    if (is_array($result)) {
        $errors = $result;
    } else {
        header('Location: register-successful.php');
    }
} else {