$stmt = $conn->prepare("SELECT * FROM users WHERE id = ?"); $stmt->bind_param("i", $id); // "i" forces integer input $stmt->execute();

$id = $_GET['id']; $stmt = $conn->prepare("SELECT * FROM users WHERE id = ?"); $stmt->bind_param("i", $id); $stmt->execute();

If you are a developer or site owner, you don't need to stop using PHP or ID parameters. Instead, follow these industry-standard security practices Use Prepared Statements:

: This could refer to a specific record or item identified by the number "1" in a database.

Attempting to "test" the security of a website you don't own—even if you're just curious—is illegal in many jurisdictions under anti-hacking laws.

Добавить комментарий