-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg.php
27 lines (22 loc) · 846 Bytes
/
reg.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
<!--man header-->
<?php include $_SERVER["DOCUMENT_ROOT"] . '/php/head.php';?>
<?php include $_SERVER["DOCUMENT_ROOT"] . '/php/menu.php';?>
<!--page info-->
<?php include $_SERVER["DOCUMENT_ROOT"] . '/php/registration.php';?>
<?php
if (isset($_POST['submitButton'])) {
include("connection.php"); //connection.php
$username = strip_tags($_POST['username']);
$password = md5($_POST['pass']);
//should do validation on passwords before submitting form
$sql = "INSERT INTO users (username, password) VALUES ('$username', '$password')";
if (mysqli_query($dbCon, $sql)) {
include("logrep.php");
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($dbCon);
}
mysqli_close($dbCon);
}
?>
<!--body-->