I am not a professional developer so my question might sound dumb, sorry for that,
I am making an android app which connects to a database of users whose passwords are stored in hashed format, so I donno how to include this function user_hash_password in my php file so I can hash the inputted password and then match it with the ones in the database, I think you can help me learn that. By the way the passwords already stored, are hashed with the same function.
Thanks a lot in advance for your help :)
<?php
$hostname = "localhost";
$database = "android";
$username = "root";
$password = "";
$localhost = mysql_connect($hostname, $username, $password)
or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $localhost);
$username = $_POST['username'];
$password = $_POST['password'];
$query = "select * from drupal_users where username = '".$username."' AND password = '".$password."'";
$query_exec = mysql_query($query) or die(mysql_error());
$rows = mysql_num_rows($query_exec);
if($rows == 0) {
echo "No user was found";
}else {
echo "User found";
}
?>