infosec/Introduccion-hacking-hack4u/tema_6_owasp/01_sqli/searchUsers.php

19 lines
405 B
PHP
Raw Normal View History

2024-02-12 22:18:28 +01:00
<?php
$server = "localhost";
$username = "s4vitar";
$password = "s4vitar123";
$database = "Hack4u";
// Establecer conexión
$conn = new mysqli($server, $username, $password, $database) or die(mysqli_error($conn));
$id = $_GET['id'];
$data = mysqli_query($conn, "select username from users where id = '$id'");
$response = mysqli_fetch_array($data);
echo $response['username'];
?>