Location: PHPKode > projects > ProjectPress > projectpress/checkuser.php
<?php

session_start(); //Starts the session.
define('access',true);
include('config.inc.php');
include(PM_DIR . 'pm-includes/global.inc.php');
require(PM_DIR . 'pm-includes/functions.php');

foreach($_GET as $key => $value) {
	$get[$key] = pmdb::connect()->escape($value);
}

$user = pmdb::connect()->escape($get['user']);

if(isset($get['cmd']) && $get['cmd'] == 'check') {

if(!is_valid_username($user)) {
echo "Invalid User ID";
exit();
}

if(empty($user) && strlen($user) <= 3) {
echo "Enter 5 chars or more";
exit();
}



$rs_duplicate = pmdb::connect()->query("select count(*) as total from " . DB . "members where username='$user'");
list($total) = $rs_duplicate->fetch_row();

	if ($total > 0)
	{
	echo "Not Available";
	} else {
	echo "Available";
	}
}
Return current item: ProjectPress