当使用标题到同一页面时,如何在链接中使用.php?name = $ _ REQUEST ['name']来保持价值?

I was doing gallery using SQL and PHP and encountered a problem. I have 3 .php files and on each one I need to get different kind of information from the same SQL database according to what I have chosen on the previous page.

I have done that by using

<a href='page3.php?name=$row[name]'> 

thing in links and it works well when you link it to another page. But now I need to use a header to the same page and it seems to lose the information after that.

Does anyone know how to keep this information while using header to the same page? Or what would be the best different way to do it?

Use

<a href='page3.php?name=<?php echo $row['name']; ?>'> 

Get the data from page3.php using:

$name = $_GET['name'];