Chomauk
Programmer
- Jun 8, 2001
- 130
I have a self processing form where I want the selected option to determine the session variable. Unfortunately I can't get it to work.
Everything appears to work but when I hit submit $_SESSION['GameWeek'] doesn't change. I'm sure it's got something to do with the input line.
HELP please?!
thanks
If you're going through hell, keep going.
--Sir Winston Churchill (1874 - 1965) British Statesman, Prime Minister, Author
Everything appears to work but when I hit submit $_SESSION['GameWeek'] doesn't change. I'm sure it's got something to do with the input line.
HELP please?!
thanks
Code:
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
?>
<html>
<head>
<?php
echo "Session = ". $_SESSION['Week'];
echo "<form action=$PHP_SELF>" ;
?>
<select size=1 name="weeknum" width=20">
<script language="javascript">
i = 1
while (i <= 17)
{
document.write('<option name=' + i + '>' + i + '</option>');
i++
}
</script>
</select>
<input type="submit" value="Submit" onClick="<?php $_SESSION['Week'] ?> = list.options[list.selectedindex].value history.go()" >
</body>
</html>
If you're going through hell, keep going.
--Sir Winston Churchill (1874 - 1965) British Statesman, Prime Minister, Author