Checking user and pass from the forum db.
Posted by: kaffir
Date: March 10, 2005 06:45AM

I have java program which require authentication. I use this now:

<?php
validateAuth();
exit();
function validateAuth() {
$Registered = array(array("username" => "public", "password" => "auth"),

);
$outputString = '';
$username = addslashes(htmlspecialchars(urldecode(strtolower($_GET['username']))));
$password = sha1(addslashes(htmlspecialchars(urldecode(strtolower($_GET['password'])))));
for($i = 0; $i < count($Registered); $i++) {
if($Registered[$i]['username'] == $username && sha1($Registered[$i]['password']) == $password) {
echo("Valid");
exit();
break;
}
}
echo("Invalid");
exit();
}
?>


But if I wanna make it to read users from mysql database? Help please? My db name is kaffir_punBB

Options: ReplyQuote


Subject
Written By
Posted
Checking user and pass from the forum db.
March 10, 2005 06:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.