Beispiel #1
0
<?php

include "SiteBanner.php";
include_once "Accounts.php";
if (CreateAccountValues()) {
    header('Location: Loading.php?Action=Create');
}
?>
		<div class="LoginBox">
			<h1>Welcome, Please Register</h1>
			<form action="Register.php" method="get">
				<div class="InputLine"><label>Username</label>  <input name="Username" type="text"></input></div>
				<div class="InputLine"><label>Password</label>  <input name="Password" type="password"></input></div>
				<div class="InputLine"><label>Name</label>  <input name="Name" type="text"></input></div>
				<div class="InputLine"><label>Email</label>  <input name="Email" type="email"></input></div>
				<div class="InputLine"><label>Phone Number</label>  <input name="Phone" type="number"></input></div>
				<button type="submit">Register</button>
			</form>
		</div>
	</Body>
</HTML>
Beispiel #2
0
<?php

//Jayden Whiley (n8498415)
include_once "Sql.php";
//Check if a create user request is posted
if (isset($_GET['Create'])) {
    CreateAccountValues();
}
//Checks if a list of strings are available in the GET array, Returns true if all are available
function CheckList($ValueList)
{
    for ($i = 0; $i < sizeof($ValueList); $i++) {
        if (empty($_GET[$ValueList[$i]])) {
            return false;
        }
    }
    return true;
}
//Returns and array from the GET array, using each of the values as an index
function GetList($ValueList)
{
    $UserValues = [];
    //define array to return
    for ($i = 0; $i < sizeof($ValueList); $i++) {
        if (empty($_GET[$ValueList[$i]])) {
            //check if value is in the GET array
            return null;
        } else {
            $UserValues[$i] = $_GET[$ValueList[$i]];
        }
    }