AIS AIS - 3 months ago 8
HTML Question

How do I pass the specific value that is clicked, in php?

I have these values in a table

<td>
<a href ="test.php>
<h4><?php echo $result_array[$i]['email_number']."<br>"; ?>
<h4>
</a>
</td>


and when I click on the value, I want 'email_number' in test.php. Any guidance would be helpful. Thank you.

Answer

You can add a query to test.php:

<a href="test.php?email=<?php echo $result_array[$i]['email_number'] ?>">

In this way you add a value in GET to test.php call and you will have like:

test.php?email=google@gmail.com

In test.php you can call:

echo $_GET["email"];