I’m try to pass parameter form my first page to the second page in the url how to make this process in safety way .
My goal sure the end user will not edit the url parameter
because i’m useing this parameter $_GET in database query
the first page
echo "<td><a class='view-report' href='viewreport.php?id=".$row['reports_id']."'><i class='fa fa-eye'></i> view </a> "."</td>";
the second page
<h3 class="h4 text-center arabic-font "> رقم البلاغ : <?=intval($_GET['id']);?> </h3>
<?php
$id = intval($_GET['id']);
$query = $con->prepare("SELECT * FROM reports WHERE reports_id = ?");
$query->execute(array($id));
echo "<pre>";
print_r($query->fetchAll());
echo "</pre>";
?>
Tags: ph