cant figure this one out
Posted: Fri Jun 08, 2007 1:46 pm
Hi ,
im new to sessions and cant figure this out:
I have javascript select menus (approximately 5 to 8 each page version)
I need their values to be passed to sessions so that i can use them on the next page OR
I would like to post them back to the same page showing what they had selected WITH the total input boxes filled with the
php math function.
so for example:
select menu 1 example
i want the selected values to be passed into sessions , so that page 2 can output (echo perhaps) the $total, $quantity and (individual) $price.
I'm not sure how to get those user-defined values and have checked google front to back with only seeing 'mail form' sessions blah blah.
anyway, this is how i tried to set those valuesin sessions.
page1.php
-----------
and the sessions on page2.php
--------------
with page2.php having the echo like this:
if you can help me figure out how to pass those javascript values in a simple less-code way that would be super freakishly great!
The Ninja Space Goat | I have edited your post to use the proper [syntax] tags
im new to sessions and cant figure this out:
I have javascript select menus (approximately 5 to 8 each page version)
I need their values to be passed to sessions so that i can use them on the next page OR
I would like to post them back to the same page showing what they had selected WITH the total input boxes filled with the
php math function.
so for example:
select menu 1 example
Code: Select all
<form action="page2.php" method="post">
<select name="quantity[]" id="b1">
<option>Please Select </option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="1500">1500</option>
</select>
<br>br>
<select name="price[]" id="select2" onchange="this.form.submit()">
<option>Please Select </option>
<option value="1.20">light</option>
<option value="1.39">medium</option>
<option value="1.42">heavy</option>
</select>i want the selected values to be passed into sessions , so that page 2 can output (echo perhaps) the $total, $quantity and (individual) $price.
I'm not sure how to get those user-defined values and have checked google front to back with only seeing 'mail form' sessions blah blah.
anyway, this is how i tried to set those valuesin sessions.
page1.php
-----------
Code: Select all
<?php
session_start();
$_SESSION['quantity'];
$_SESSION['sizeprice'];
?>--------------
Code: Select all
<?php
session_start();
?>Code: Select all
<input name="findval" value="<?php echo $_SESSION['quantity'] ?>" size="100">The Ninja Space Goat | I have edited your post to use the proper [syntax] tags