:juggle:
PHP Code:
<?php
function anti_injection( $user)
{
$banlist = array
(
"insert", "select", "'", "shutdown", "_", "-", ".", "#", "!", "update", "delete", "distinct", "having", "truncate", "replace",
"handler", "like", "procedure", "limit", "order by", "group by", "asc", "desc"
);
if ( eregi ( "[a-zA-Z0-9]+", $user ) )
{
$user = trim ( str_replace ( $banlist, '', strtolower ( $user ) ) );
}
else
{
$user = NULL;
}
$array = array ( 'user' => $user);
if ( in_array ( NULL, $array ) )
{
die ( 'Invalid ID, Please choose another one' );
}
else
{
return $user;
}
}
?>
<?
$user = $_GET['user'];
$user = anti_injection ( $_GET['user']);
mssql_select_db("kal_auth");
$check_login = mssql_query("SELECT [ID] FROM [Login] WHERE [ID] = '$user'");
if(mssql_num_rows($check_login))
{
die("<font color='#FF0000'>Account ID: <strong>$user</strong> is already taken </font>");
}
echo "<font color='#006600'>Account ID: <strong>$user</strong> is Available </font>" ;
?>
PHP Code:
<script type="text/javascript">
function idchklol() {
var usern = form1.account_name.value;
var urlx = "./idchk.php?user=" + usern;
window.open( urlx , "myWindow",
"status = 1, height = 150, width = 300, resizable = 0" )
}
</script>
PHP Code:
<input type="button" onClick="idchklol()" value="Check Availablity">