-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignupcheck.php
37 lines (37 loc) · 1.36 KB
/
signupcheck.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="signupCSS.css">
<title>Sign Up</title>
</head>
<body background="https://cdn.wallpapersafari.com/40/29/yUNO4z.jpg">
<?php
$con=mysqli_connect("localhost","root","");
mysqli_select_db($con,"guitar_shop");
$username = $_POST["Username_signup"];
$password = $_POST["pass_signup"];
$Rpassword = $_POST["repeatPass"];
$mail = $_POST["Email"];
$Fname = $_POST["FullName"];
$sur = $_POST["Surname"];
$Country = $_POST["Country"];
if ($password!=$Rpassword) { echo "password must be the same <a href=signup.php>go back</a>";}
elseif(strlen($password)<6){ echo "password must be 6 characters long <a href=signup.php>go back</a>";}
elseif(!isset($username)){ echo "enter a username <a href=signup.php>go back</a>";}
elseif(!isset($mail)){ echo "enter a mail <a href=signup.php>go back</a>";}
else {
$query = "insert into users (username,pass,email,country,surname,Name) values('".$username."','".sha1($password)."','".$mail."','".$Country."','".$sur."','".$Fname."')";
$result=mysqli_query($con,$query);
if (!$result) {
echo "something went wrong <a href=signup.php>go back</a>";
echo mysqli_error($con);
}
else
{
header('location: Index.html');
}
}
?>
</body>
</html>;