# Php variable in form action

**URL:** <https://forum.kirupa.com/t/php-variable-in-form-action/313069>\
**Category:** Uncategorized\
**Created:** [August 19, 2010, 3:04am UTC](https://forum.kirupa.com/t/php-variable-in-form-action/313069 "2010-08-19T03:04:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyderfx](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spyderfx](https://forum.kirupa.com/u/spyderfx)\
**Post date:** [August 19, 2010, 3:04am UTC](https://forum.kirupa.com/t/php-variable-in-form-action/313069/1 "2010-08-19T03:04:58Z")

</div>

I’m trying to have my submit button send the user to a different page, and the only way I know how to do that is by putting the page url in the forms “action” attribute. The problem is that I need to pass a variable to the page they are going to such as:

seeall.php?day=0

How do I set the variable in the action attribute from the same page so that the day value is passed when they submit? Is there a way to run a function on the same page and have php to send them to a new page when they hit submit?

Thanks
