Simple Auth Code For PHP4
Download
View Source (print view)
Rating : 4.7
Views : 578
<?
# Simple Auth For PHP4
# I use mysql but you can change this to what ever you want to.
# Reject All Anonymous Logins
if((!$_POST[var_username]) || (!$_POST[var_password])){
header("Location: http://some_file_or_address_here");
exit;
}
# Run Query
$sql = mysql_query("select * from Table where Username='$_POST[var_username]' and Password='$_POST[var_password]'") or die (mysql_error());
$get = mysql_numrows($sql);
if($get == "1"){
print("Auth Granted");
} else { $get="3"; }
if($get == "0"){
print("Auth False");
} else { $get="3"; }
if($get == "3"){
print("Log there ip or run some statement here. Dont just let them off the hook.");
}
?>
guest, enfactuation, rent a car, download, regirstration form, php_snips, fedex, call php', userstatusinonline, php_script"_class="neww"_target="_blank"_title="im_neuen, best ide, php script" class="neww" target="_b..., forum, p t test paired, php_tools, href php function, utfraw, php jobs, php script and char(124) (select cast(count(1) as varchar(8000)) char(124) from [sysobjects] where 1=1)>0 and =, commit