Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require '_build/_php/functions.php';
- initialize_database();
- if ( !$_SESSION['username'] ) : ?>
- Please input your details and then hit 'Register'.
- <?php if ( !$_POST['register'] ) : ?>
- <form method="post">
- <input type="text" name="email" value="" /><br />
- <input type="text" name="first-name" value="" /><br />
- <input type="text" name="last-name" value="" /><br />
- <select name="gender">
- <option selected="selected" disabled="disabled">Select a gender...</option>
- <option value="male">Male</option>
- <option value="female">Female</option>
- </select><br />
- <input type="text" name="birthday-day" value="" size="1" /> /
- <input type="text" name="birthday-month" value="" size="1" /> /
- <input type="text" name="birthday-year" value="" size="2" /><br />
- <input type="text" name="username" value="" /><br />
- <input type="password" name="password" value="" /><br />
- <input type="password" name="password-verification" value="" /><br />
- <input type="submit" name="register" value="Register" />
- </form>
- <? else :
- $user = array(
- 'email' => $_POST['email'],
- 'first-name' => $_POST['first-name'],
- 'last-name' => $_POST['last-name'],
- 'gender' => $_POST['gender'],
- 'username' => $_POST['username'],
- 'password' => md5 ( $_POST['password'] ),
- 'birthday' => $_POST['birthday-day'] . '/' . $_POST['birthday-month'] . '/' . $_POST['birthday-year']
- );
- if ( in_array( '', $user ) ) :
- print 'It looks like you left something blank.';
- else :
- print 'You have not left anything blank.';
- endif;
- endif; ?>
- <? else :
- header('Location: index.php');
- endif;
- ?>
Add Comment
Please, Sign In to add comment