-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
40 lines (39 loc) · 1.32 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
<?php
session_start();
include("connection.php");
include("functions.php");
if($_SERVER['REQUEST_METHOD']=="POST")
{
$user_name = $_POST['user_name'];
$password = $_POST['password'];
if(!empty($user_name)&& !empty($password) && !is_numeric($user_name))
{
$user_id = random_num(20);
$query = "insert into users (user_id,user_name,password) values ('$user_id','$user_name','$password')";
mysqli_query($con, $query);
header("Location: login.php");
die;
}
else
{
echo " please enter valid information";
}
}
?>
<html>
<head>
<title>login</title>
<link rel="stylesheet" href="style.css">
</head>
<body background="3607424.jpg">
<div class="form">
<form method="post">
<h2>SIGN UP HERE</h2>
<input id="text" type="text" name="user_name" placeholder="Enter Email Here">
<input id="text" type="password" name="password" placeholder="Enter Password Here">
<button class="btnn" id="button" type="submit" value="signup">Signup</button><br><br>
<p class="link"> <a href="login.php">Login here</a></p>
</form>
</div>
</body>
</html>