first commit
This commit is contained in:
29
validation/usercheck.php
Executable file
29
validation/usercheck.php
Executable file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require_once("func_validEmail.php");
|
||||
require_once("../config/datenbankanbindung.php");
|
||||
|
||||
// Get the user id from URL
|
||||
#$search=htmlspecialchars(mysql_real_escape_string($_GET["search"]));
|
||||
$search=strtolower($_GET["search"]);
|
||||
if(validEmail($search)){
|
||||
$db = dbconnect();
|
||||
$query = $db->query("SELECT * FROM imt_user WHERE lower(mail) = '" .$search."'") or die(mysql_error()); // Change users to the database where you keep your usernames, and likewise with username
|
||||
|
||||
list($user_id) = $query->fetch_array();
|
||||
$row = $query->fetch_array();
|
||||
if(empty($user_id))
|
||||
{
|
||||
$check = '<span class="correct">Der Benutzer ist verfügbar.</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$check = '<span class="wrong">Der Benutzer ist im System bereits vorhanden!</span>';
|
||||
}
|
||||
}else{
|
||||
#$check = '<span class="wrong">Ungültiges Mailformat oder Domain ist falsch</span>';
|
||||
$check = '';
|
||||
}
|
||||
|
||||
// Echos whether the user exists or not.
|
||||
echo $check;
|
||||
?>
|
Reference in New Issue
Block a user