-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
85 lines (80 loc) · 3.19 KB
/
signup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php include 'includes/session.php'; ?>
<?php
if(isset($_SESSION['user'])){
header('location: cart_view.php');
}
if(isset($_SESSION['captcha'])){
$now = time();
if($now >= $_SESSION['captcha']){
unset($_SESSION['captcha']);
}
}
?>
<?php include 'includes/header.php'; ?>
<body class="hold-transition register-page">
<div class="register-box">
<?php
if(isset($_SESSION['error'])){
echo "
<div class='callout callout-danger text-center'>
<p>".$_SESSION['error']."</p>
</div>
";
unset($_SESSION['error']);
}
if(isset($_SESSION['success'])){
echo "
<div class='callout callout-success text-center'>
<p>".$_SESSION['success']."</p>
</div>
";
unset($_SESSION['success']);
}
?>
<div class="register-box-body">
<p class="login-box-msg">Register a new membership</p>
<form action="register.php" method="POST">
<div class="form-group has-feedback">
<input type="text" class="form-control" name="firstname" placeholder="Firstname" value="<?php echo (isset($_SESSION['firstname'])) ? $_SESSION['firstname'] : '' ?>" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="text" class="form-control" name="lastname" placeholder="Lastname" value="<?php echo (isset($_SESSION['lastname'])) ? $_SESSION['lastname'] : '' ?>" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="email" class="form-control" name="email" placeholder="Email" value="<?php echo (isset($_SESSION['email'])) ? $_SESSION['email'] : '' ?>" required>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" name="password" placeholder="Password" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" name="repassword" placeholder="Retype password" required>
<span class="glyphicon glyphicon-log-in form-control-feedback"></span>
</div>
<?php
if(!isset($_SESSION['captcha'])){
echo '
<di class="form-group" style="width:100%;">
<div class="g-recaptcha" data-sitekey="6LevO1IUAAAAAFX5PpmtEoCxwae-I8cCQrbhTfM6"></div>
</di>
';
}
?>
<hr>
<div class="row">
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat" name="signup"><i class="fa fa-pencil"></i> Sign Up</button>
</div>
</div>
</form>
<br>
<a href="login.php">I already have a membership</a><br>
<a href="index.php"><i class="fa fa-home"></i> Home</a>
</div>
</div>
<?php include 'includes/scripts.php' ?>
</body>
</html>