<?php


require( "_inc.php" );
$type = trim( $_GET['type'] );
$value = trim( $_GET['value'] );
$value = ereg_replace( " |　", "", $value );
if ( empty( $type ) || empty( $value ) )
{
	exit( "不能为空。" );
}
if ( "userName" == $type && ( strlen( $value ) < 2 || strpos( $value, "\\" ) || ereg( "<|>|'|\"", $value ) ) )
{
	exit( "用户名不合规定。" );
}
$sql = "";
switch ( $type )
{
case "userName" :
	$sql = "SELECT f_id FROM ".$gDb['prefix'].( "users WHERE (f_userName='".$value."')" );
	break;
	exit( "非法访问。" );
}
$arrResult = $db->fetchrow( $sql );
if ( !empty( $arrResult['f_id'] ) )
{
	exit( "很遗憾，<strong>".$value."</strong>已经被注册了。请换一个试试。" );
}
exit( "<span style='display:none'>√</span>恭喜，可以使用。" );
?>
