views:

61

answers:

2

Okay

I have two pages-- page1.php and page2.php .Both of these pages have select lists.I have posted the values selected by the user to script.php which has them stored in session variables.

I need to add the values (which are the ones selected by the user from the select lists in both the pages) and display this total value in page3.php.now how do i add these values in the script?

any suggestions would be helpful.thanks in advance.

A: 

$_session['var1] + $_session['var2']

surdipkrishna
+2  A: 

If I get your problem correctly, you can just fetch values directly from $_SESSION variable:

$total = $_SESSION['value1'] + $_SESSION['value2'];

Of course you should also check if the session variables are set at all and are correct (numeric). The $_SESSION (and not $_session!) is one of the "superglobal" variables in PHP - read more.

bth