File size: 1.2Kb
<?php
include('head.php');
require_once('session.php');
if (isset($_POST['submitBtn'])){$username = isset($_POST['username']) ? $_POST['username'] : '';
$password1 = isset($_POST['password1']) ? $_POST['password1'] : '';
$password2 = isset($_POST['password2']) ? $_POST['password2'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$error = registerUser($username,$password1,$password2,$email);
}
?>
<?php if ((!isset($_POST['submitBtn'])) || ($error != '')) {?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="registerform"><center>
<img src="img/1_2.gif"/><br/>Username:<br/><input class="text" name="username" type="text" /><br/>
Password:<br/><input class="text" name="password1" type="password" /><br/>
Confirm password:<br/> <input class="text" name="password2" type="password" /><br/>
E-mail<br/> <input class="text" name="email" type="email" /><br/>
<input class="text" type="submit" name="submitBtn" value="Register" />
</center></form>
<?php
}
if (isset($_POST['submitBtn'])){
?>
<?php
if ($error == '') {
echo "<center>Registered successfully!<br/>";
echo '<a href="login.php">Continue...</a></center>';
}
else echo $error;
?>
<?php
}
?>
<?php include('foot.php'); ?>