我怎样才能在上一页上使用变量

I have a form for search user on like index.php?topic=pagename

I assign to variable what i wrote search form. So like ;

$name= $_POST['username'];

Everything okay, i can run this query on same page.

But i want to add new query under the previous query's result.

So like ;

$name have 5 euro.

Add money : NEW FORM

I can add form for add new money to under the previous query echo's. It seems. And it runs but i cant use previous variable $name .

Btw, add money form run on same page

What about just storing that value in a hidden input in the new form?

// new form
<input type="hidden" name="name" value="<?= $name ?>"/>

Use sessions for this.

Store data in session, then use it in previous page. http://www.w3schools.com/php/php_sessions.asp