-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
58 lines (54 loc) · 2.06 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
<?php include 'php/templates/header.php'; ?>
<?php include 'php/templates/jumbotron.php'; ?>
<p> </p>
<div class="ui text container">
<div class="ui segment" style="max-width: 350px; margin: 0 auto">
<div></div>
<h1 class="ui center aligned header" style="color: #585858">
Create an account
<div class="sub header" style="color: #989898">Hello! Welcome come to join us!</div>
</h1>
<form class="ui form">
<div class="field">
<label>Username</label>
<input type="text" name="username">
</div>
<div class="field">
<label>Password</label>
<input type="password" name="password">
</div>
<div class="ui negative hidden message">
Username or password was incorrect.
</div>
<button class="ui fluid blue button" type="submit">Sign up</button>
<br>
<button class="ui fluid button" type="submit" data-href="signin.php">I already have an account</button>
</form>
<script>
$('form').on('submit', function(e)
{
e.preventDefault()
$('.negative.message').addClass('hidden')
$.ajax({
url: 'https://fishevents-api-chown9835.c9users.io/auth',
data: {
'username': $('[name="username"]').val(),
'password': $('[name="password"]').val()
},
type : "PUT",
dataType: 'json',
success: function(msg)
{
window.location.href = "my-account.php?welcome=true"
$('.negative.message').addClass('hidden')
},
error: function(xhr, ajaxOptions, thrownError)
{
$('.negative.message').removeClass('hidden')
}
});
})
</script>
</div>
</div>
<?php include 'php/templates/footer.php'; ?>