Have two forms in one page and set session

i have two file and two forms:

file 1:

<form name="name1" action="form2.php" method="post">
     <input <? $_session['define'] = 'value1' ?> type="submit" ...>
</form>
<form name="name2" action="form2.php" method="post">
     <input <? $_session['define'] = 'value2' ?> type="submit" ...>
</form>

As you see i have two forms and two different submit buttons but when i press each of them, the second value (the last) set to the $_session[‘define’] and in the second form i always have ‘value2’.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s