Home » Php » how I can pass parameter from one page to anther page in secure way? [on hold]

how I can pass parameter from one page to anther page in secure way? [on hold]

Posted by: admin October 29, 2018 Leave a comment

Questions:

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>";

  ?> 
Answers: