Home  >  Q&A  >  body text

How to send id to another page in php?

I have an attendance management system, which has two tables attendance and employees. In this system, there is a page that displays the names of all employees and it is set as a hyperlink as shown below

<?php echo "<a href='attendance_add.php'>" . $row['emp_name'] . "</a> "; ?>

But I want to send employee_id to attendance_add.php page. So how do I send it?

P粉323050780P粉323050780210 days ago255

reply all(1)I'll reply

  • P粉709644700

    P粉7096447002024-02-27 09:34:09

    You would do something like:

    <?php echo "<a href='attendance_add.php?id=".$row['employee_id']."'>" . $row['emp_name'] . "</a> ; "; ?>

    You will then capture the id from the url using $_GET['id'] inside

    attendance_add.php

    reply
    0
  • Cancelreply