-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.php
More file actions
44 lines (34 loc) · 1010 Bytes
/
Copy pathcheck.php
File metadata and controls
44 lines (34 loc) · 1010 Bytes
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
<?php
include "config/conn.php";
include "lib/Database.php";
include "helpers/Format.php";
$db = new Database();
$format = new Format();
//for username
if(isset($_POST["user_name"])){
$user = $format->Stext($_POST["user_name"]);
$querycheck = "SELECT * FROM register WHERE user_name='$user'";
$Check = $db->select($querycheck);
//mysqli_num_rows($Check) > 0
if($Check){
echo "<span class='text-danger'>X Username not available</span>";
}
else{
echo "<span class='text-success'>Username available</span>";
}
}
//For Email
if(isset($_POST["user_email"])){
$userEmail = $format->Stext($_POST["user_email"]);
$queryEmailcheck = "SELECT * FROM register WHERE user_login='$userEmail'";
$Check = $db->select($queryEmailcheck);
//mysqli_num_rows($Check) > 0
if($Check)
{
echo "<span class='text-danger'>It look like you already have an account.<br>Please Login</span>";
}
else{
echo "<span class='text-success'></span>";
}
}
?>