-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistration.php
59 lines (42 loc) · 1.5 KB
/
registration.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
<html>
<body>
<?php include("navbar.php");?>
<script src="sortable.js"> </script>
<div class="container row-offcanvas row-offcanvas-left">
<div class="well column col-lg-12 col-sm-12 col-xs-12" id="content">
<!--Page content-->
<div class="section3">
<h1>Register</h1>
</div>
<div class = "section3">
<div style="width: 50%; margin: 0 auto;">
<?php
if($_POST["ID"]){
include("databaseName16.php");
$con= mysql_connect($address, $username, $password);
if (!$con){
die('Could not connect: ' . mysql_error());
}
mysql_select_db($database, $con);
mysql_query('INSERT INTO '.$userDatabase.' VALUES ("'.htmlspecialchars($_POST["Name"]).'","'.htmlspecialchars($_POST["ID"]).'","0")');
echo("<h3>Thank you for registering. Please do not refresh.</h3>");
}
else{
echo('
<form method = "POST" id= "regForm" style="width: 50%; margin: 0 auto;">
<h3 style="text-align: center;">Name</h3>
<input type="text" style="margin: auto;margin-left: auto;margin-right: auto; display:block;" id="Name" name="Name">
<h3 style="text-align: center;">ID</h3>
<input type="text" style="margin: auto;margin-left: auto;margin-right: auto; display:block;" id = "ID" name="ID">
<br>
<input style="margin: 0 auto;margin-left: auto;margin-right: auto; display:block;" class="myButton" type="submit" value="Submit"><br>
</form>
');
}
?>
</div>
</div>
</div>
</div>
</body>
</html>