# Carrying over variables in form

**URL:** <https://forum.kirupa.com/t/carrying-over-variables-in-form/265364>\
**Category:** programming\
**Created:** [July 8, 2008, 3:00am UTC](https://forum.kirupa.com/t/carrying-over-variables-in-form/265364 "2008-07-08T03:00:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksfkay](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@ksfkay](https://forum.kirupa.com/u/ksfkay)\
**Post date:** [July 8, 2008, 3:00am UTC](https://forum.kirupa.com/t/carrying-over-variables-in-form/265364/1 "2008-07-08T03:00:24Z")

</div>

hi folks, i hope someone could help me. i’m stuck on php. i’m not all familiar with php, so please bare with me as i ask this question…

I’m trying to carry over a variables from a form field using php. i have

\<form action=“generated\_page.php” method=“post” accept-charset=“utf-8”\>  
\<input type=“text” value=“Text” name=“bb[name]”\>  
\<input type=“submit” value=“display name”\>

then on generated\_page.php i have:

\<p\>Welcome \<?= $bb-\> name ?\>\</p\>

i can’t figure out how to display the name from the form field after i hit submit to add on the following page. can anyone help?

---

<div class="post-metadata">

**Author:** ![hl1](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hl1/32/849_2.png) [@hl1](https://forum.kirupa.com/u/hl1)\
**Post date:** [July 8, 2008, 3:51am UTC](https://forum.kirupa.com/t/carrying-over-variables-in-form/265364/2 "2008-07-08T03:51:57Z")

</div>

Use sessions. A quick search should give you an understanding of them.

---

<div class="post-metadata">

**Author:** ![utsav](https://avatars.discourse-cdn.com/v4/letter/u/e19b73/32.png) [@utsav](https://forum.kirupa.com/u/utsav)\
**Post date:** [July 10, 2008, 12:59am UTC](https://forum.kirupa.com/t/carrying-over-variables-in-form/265364/3 "2008-07-10T00:59:29Z")

</div>

Collect the textbox value in your “generated\_page.php”.  
Try [COLOR=“Red”]$name=$\_POST[textbox name];[/COLOR]

Hope this works.
