Hi guys
I'm trying to create a login system on my site that uses the login information from my phpBB forum. I'm having trouble retrieving the password hash from the forum database. I'm a bit of a newbie to php so am a bit lost. Thanks in advanced.
<?php
//include functions.php/function.php
include ("functions.php");
//ob
ob_start();
//session
session_start();
$username = addslashes(strip_tags(strtolower($_POST['username'])));
$password = addslashes(strip_tags($_POST['password']));
if (empty($username) == FALSE && empty($password) == FALSE) {
//connect
$con=mysqli_connect("localhost","client106959","******","EMUAS");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$find = mysqli_query($con, "SELECT * FROM user WHERE username_clean='$username'");
$find_row = mysqli_fetch_array($find);
//grab password
$password_hash = $find_row['user_password'];
echo ($username);
echo ($password);
echo ($password_hash);
}
else{
echo ('<script type="text/javascript">
alert("Please Enter a Username and Password");
</script>');
header("Location: {$_SERVER['HTTP_REFERER']}");
}
mysqli_close($con);
?>