Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

$username = $_POST['username']; $password = $_POST['password']; // Vulnerable SQL qu..

Decoded Output download

<?   
$username = $_POST['username']; 
$password = $_POST['password']; 
 
// Vulnerable SQL query 
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'"; 
$result = mysqli_query($connection, $query); 
 
 
if (mysqli_num_rows($result) > 0) { 
    // User authenticated successfully 
    echo "Login successful!"; 
} else { 
    // Invalid credentials 
    echo "Login failed!"; 
} 
 ?>

Did this file decode correctly?

Original Code


$username = $_POST['username'];
$password = $_POST['password'];

// Vulnerable SQL query
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
$result = mysqli_query($connection, $query);


if (mysqli_num_rows($result) > 0) {
    // User authenticated successfully
    echo "Login successful!";
} else {
    // Invalid credentials
    echo "Login failed!";
}

Function Calls

mysqli_query 1

Variables

$query SELECT * FROM users WHERE username = 'None' AND password = '..
$password None
$username None

Stats

MD5 342a136b9daaeae9f782e128fc0c5651
Eval Count 0
Decode Time 81 ms