-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuid_verify.php
More file actions
44 lines (42 loc) · 1.74 KB
/
Copy pathuid_verify.php
File metadata and controls
44 lines (42 loc) · 1.74 KB
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
require_once('mysql_conn.php');
if(isset($_POST['uid']))
{
$uid = $_POST['uid'];
$sql = "SELECT * FROM users WHERE user_id = '$uid'";
$result = mysql_query($sql);
if ($uid == "") {
echo '<strong style="color: red">' . $uid . '</strong>'.'<strong style="color:red"> is taken or null</strong><br><input type="hidden" id="check_uid" name="check_uid" value=""/>';
}
else if(mysql_fetch_array($result) > 0)
{
echo '<strong style="color: red">' . $uid . '</strong>'.'<strong style="color:red"> is taken</strong><br><input type="hidden" id="check_uid" name="check_uid" value=""/>';
}
else
{
echo '<strong style="color: green">' . $uid . '</strong>'.'<strong style="color:green"> is OK</strong><br><input type="hidden" id="check_uid" name="check_uid" value="ok" required/>';
}
}
/*
if(isset($_POST["name2check"]) && $_POST["name2check"] != ""){
include_once 'mysql_conn.php';
$username = $_POST['name2check'];
$sql_uname_check = mysql_query("SELECT id FROM users WHERE user_id='$username' LIMIT 1");
$uname_check = mysql_num_rows($sql_uname_check);
if (strlen($username) < 4) {
echo '<strong style="color: red">'.' 4 - 15 characters please '.'</strong>';
exit();
}
if (is_numeric($username[0])) {
echo '<strong style="color: red">'.' First character must be a letter '.'</strong>';
exit();
}
if ($uname_check < 1) {
echo '<strong style="color: green">' . $username . '</strong>'.'<strong style="color:green"> is OK</strong>';
exit();
} else {
echo '<strong style="color: red">' . $username . '</strong>'.'<strong style="color:red"> is taken</strong>';
exit();
}
}*/
?>