I am no good in PHP I am using this check function for my C# application issue being it 500 errors on a certain function in the php
Here is the code
It gives the 500 error on this
Here is the code
PHP Code
<?php
$link = mysqli_connect("localhost", "DB_NAME","DBPASSWORD");
$database = mysqli_select_db($link, "DB_NAME");
$user = $_GET['username'];
$password = $_GET['password'];;
$tables = "mybb_users";
$sql = "SELECT * FROM ". $tables ." WHERE username = '". mysqli_real_escape_string($link,$user) ."'" ;
$result = $link->query($sql);
if ($result->num_rows > 0) {
// Outputting the rows
while($row = $result->fetch_assoc())
{
$password = $row['password'];
$salt = $row['salt'];
$plain_pass = $_GET['password'];
$stored_pass = md5(md5($salt).md5($plain_pass));
function Redirect($url, $permanent = false)
{
if (headers_sent() === false)
{
header('Location: ' . $url, true, ($permanent === true) ? 301 : 302);
}
exit();
}
if($stored_pass != $row['password'])
{
echo "p0<br>"; // Wrong pass, user exists
}
else
{
echo "p1<br>"; // Correct pass
}
echo "g" . $row['usergroup'] . "<br>";
}
}
?>It gives the 500 error on this
PHP Code
<?php
$result = $link->query($sql);


