-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
55 lines (51 loc) · 1.51 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
<?php
session_start();
if(isset($_POST['signup'])){
require 'connect.php';
$nume=$_POST['Nume'];
$prenume=$_POST['Prenume'];
$user=$_POST['Email'];
$pass=$_POST['password'];
$date=$_POST['ziNastere'];
if($nume==''||$prenume==''||$user==''||$pass==''||$date==''){
alert("completati toate campurile");
echo '<script>window.location.href = "signup.php";</script>';
}
$result=$conn->query("insert into users(first_name,last_name,e_mail,password,birthday) "
. "values('$nume','$prenume','$user','$pass','$date')");
if(!$result)
alert("query error");
else{
alert("Contul a fost inregistrat !");
echo '<script>window.location.href = "index.html";</script>';
}
}
?>
<html>
<head>
<title>SignUp</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/styleSignup.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<title>Index</title>
</head>
<body>
<div class="SignUp">
<i class="material-icons">person</i>
<form method='post'>
<p>Nume</p>
<input type="text" name="Nume">
<p>Prenume</p>
<input type="text" name="Prenume">
<p>E-mail</p>
<input type="email" name="Email">
<p>Parolă</p>
<input type="password" name="password">
<p>Zi de naștere</p>
<input type="date" name="ziNastere"><br>
<input type="submit" name="signup" value="Înscrie-te">
</form>
</div>
</body>
</html>