0

What is the most safe approach?

This one:

$id = mysqli_real_escape_string($link, $_POST['id']);
echo $id;

Or this one:

$unsafe_id = $_GET['id'];
$safe_id = (int)$unsafe_id;
echo safe_id;
Erik Auranaune
  • 1,384
  • 1
  • 12
  • 27

0 Answers0