By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,149 Members | 1,796 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,149 IT Pros & Developers. It's quick & easy.

Dropdown Menu Passing Last Row as Session Variable

P: 18
Recently my web host decided to "upgrade". This change rendered many of my pages useless and I am scrambling to fix the issues, so you may see several posts from me in the coming days.

My first issue is that all of my dropdown menus are passing the last row to the next page as the session variable. The pages that I am talking about can be found at:


The code that follows was operational until the change. Here is my code:
<? php



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>The Weekly 13: Test</title>
<div class="body">

<?php // Grabs header for site
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec ($curl);
curl_close ($curl);
print $result;

<form method="post" name="picks1.php" action="test.php">
style="width: 35%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="0" cellspacing="10">
<td style="width: 83px;" colspan="1"
<img style="width: 80px; height: 83px;" alt=""
<td style="text-align: right; width: 25%; font-weight: bold;">
<td align="undefined" valign="center"><p1>
<?php //Sets Year to current season
$Year = '2007';
echo $Year;
$_SESSION['Year'] = $Year;
<td style="text-align: right; font-weight: bold;"
<?php //Displays League Dropdown Menu, stores league session variable
$queryA = mysql_query("SELECT League, LeagueNumber
FROM NCF_leagues ORDER BY `NCF_leagues`.`LeagueNumber` ASC");
echo "<form action=something.php method=POST>
<select name=League>";
while ($r = mysql_fetch_array($queryA))
{ $League = $r["League"];
$LeagueNumber = $r["LeagueNumber"];
echo "<option value='$LeagueNumber'>$League</option>";
echo "</select>";
$_SESSION['League'] = $League;
<td style="text-align: right; font-weight: bold;">
<?php // Displays Week Dropdown Menu, stores Week session variable
$queryB = mysql_query("SELECT WeekName, WeekID FROM NCF_weeks
ORDER BY `NCF_weeks`.`WeekID` ASC");
echo "<form action=something.php method=POST>
<select name=Week>";
while ($r = mysql_fetch_array($queryB))
{ $Week = $r["WeekName"];
$WeekID = $r["WeekID"];
echo "<option value='$WeekID'>$Week</option>";
echo "</select>";
$_SESSION['Week'] = $Week;

<td colspan="3" rowspan="1" align="undefined"
<hr noshade="noshade">
<div style="text-align: right;"><input
value="Reset Form" type="reset"> <input
name="submitok" value=" OK " type="submit"> </div>

<!-- Current Session Variables:



I do not know if the problem exists within my code or within the php.ini that my host now defaults too.

Thanks for any help!
Dec 21 '07 #1
Share this Question
Share on Google+
1 Reply

P: 18
I see no one has responded. Perhaps I should re-write my question.

I got most variables to pass from one page to the next, however one continues to fail.

<?php session_save_path("/xxxxxx/");
session_start(); ?>

--SOME HTML Code--

<?php //Sets Season to current season

$Season = '2007';
echo $Season;
$_SESSION['Season'] = $Season;


If anyone has suggestions on why this variable may not be passing, I'd greatly appreciate any help.

I have several variables that are selected by the user from dropdown menus that pass to the next page. Here is the link again: Weekly13 - Test
Dec 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.