-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1
43 lines (30 loc) · 812 Bytes
/
1
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
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);
$host = "34.66.215.92";
$dbusername = "root";
$dbpassword = "";
$dbname ="users";
$errors= array();
$conn =mysqli_connect ($host, $dbusername, $dbpassword ,$dbname);
if (myqli_connect_error($conn){
echo "connection didnt happen";}
else {
echo"connection success"; }
if(isset($_POST['submit'])){
$user = $_POST['user'];
$pass = $_POST['pass'];
$verifypass = $_POST['verifypass'];
$sql_e = "SELECT * FROM loginform where user = '$user'";
$result = mysqli_query($conn, $sql_e);
$num = mysqli_num_rows($result);
if($num == 1){
echo " Email Already taken";
}
else{
$done = "insert into loginform(user,password) values ('$user', '$pass')";
mysqli_query($conn,$done)
echo " Successful registering";
}
mysqli_close($conn);
?>