Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session problem

Status
Not open for further replies.

gokeeffe

Programmer
Jan 11, 2005
170
IE
Hi,

I am working on the following piece of code (which I found on the internet)

to allow me to populate dropdowns dynamically from a mysql database. There

are a number of associated Javascript files that are part of this code (which I

don't really understand but work fine). The question I have inrelation to this

code is how do I convert the options that are choosen in the dropdowns into

sessions as I will need to pass these variable on to other pages.

------------------------------ Code -------------------------------------

<html>
<head>
<title>JSRS Select Demo</title>
<script language="javascript" src="jsrsClient.js"></script>
<script language="javascript" src="selectphp.js"></script>
</head>

<?php
$make = isset($_POST['lstMake']) ? $_POST['lstMake'] : -99;
$model = isset($_POST['lstModel']) ? $_POST['lstModel'] : -99;
$options = isset($_POST['lstOptions']) ? $_POST['lstOptions'] : -99;
?>

<body onload="preselect('<?php echo $make;?>', '<?php echo $model;?>', '<?php echo $options;?>', 1);"
onhelp="jsrsDebugInfo();return false;">



<form name="QForm" method="post" action="./test.php">
<table class="normal" width="575" BORDER="0" CELLSPACING="2" CELLPADDING="2" VALIGN="TOP">
<?php
SelectBox ("Make", "lstMake");
SelectBox ("Model", "lstModel");
SelectBox ("Options", "lstOptions");
?>
</table>
<input type="submit" name="cmdSubmit" value="Submit" id="cmdSubmit" title="Show selects with preselected values" style="" /><br />
</form>

</body>
</html>

----------------------------- End of code -------------------------------

Regards & Thanks

Graham
 
Read up on sessions in the PHP manual. Tek-Tips are meant for helping you with problems not write code for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top