-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
88 lines (72 loc) · 2.23 KB
/
index.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
86
87
88
<!-- JOSEPH BIESELIN - Texty Web App -->
<?php
session_start();
session_unset();
session_destroy();
// If index.php is loaded, a user logged out or someone just registerd so we must unset all session variables and destroy the session
?>
<!-- index.php is equivalent to index.html aside from php's session handling at the top of this file -->
<!DOCTYPE html>
<html>
<head>
<title>texty</title>
</head>
<body>
<h1>You've reached texty!</h1>
<!-- Javascript for form validation -->
<script>
function check_signin() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username.indexOf(",") != -1 || password.indexOf(",") != -1) {
alert("Can't submit with ',' in any input fields");
return false;
}
if (username.indexOf(" ") != -1) {
alert("Can't submit with spaces in the username");
return false;
}
if (username.length > 16) {
alert("Username is limited to 16 characters");
return false;
}
if (password.length > 16) {
alert("Password is limited to 16 characters");
return false;
}
alert('Data being submitted');
return true;
}
</script>
<form onsubmit="return check_signin()" method="post" action="check_user.php" autocomplete="on">
<fieldset>
<p>
<table>
<tr>
<th align="left">
Username: <input type="text" name="username" placeholder="Enter your username here" id="username" required>
</th>
<th align="right">
Password: <input type="password" name="password" placeholder="Enter your password here" id="password" required>
</th>
<th align="center">
<input type="submit" value="Sign In">
</th>
</tr>
<tr>
<td></td>
<td></td>
<td align="center">
<a href="register.html" style="color:rgb(180,150,20)"><u>Register</u></a>
</td>
</tr>
</table>
<p>
</fieldset>
</form>
<p align="center" style="font-size:100px"><u><b>texty</b></u></p>
<p align="center">Take what you want to say and put it on the internet forever</p>
<hr/>
<a href="deactivate.html"><u>Deactivate Account</u></a>
</body>
</html>