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

Dropdown Menu Passing Last Row as Session Variable

SHOverine
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:

Weekly13_Test

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

session_start();

?>

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

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

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

<form method="post" name="picks1.php" action="test.php">
<table
style="width: 35%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="0" cellspacing="10">
<tbody>
<tr>
<td style="width: 83px;" colspan="1"
rowspan="3">
<img style="width: 80px; height: 83px;" alt=""
src="http://theweekly13.com/images/core/pabstheader.jpg"></td>
<td style="text-align: right; width: 25%; font-weight: bold;">
<p1>Season:</p1>
</td>
<td align="undefined" valign="center"><p1>
<?php //Sets Year to current season
$Year = '2007';
echo $Year;
$_SESSION['Year'] = $Year;
?>
</p1>
</td>
</tr>
<tr>
<td style="text-align: right; font-weight: bold;"
valign="undefined">
<p1>League:</p1>
</td>
<td>
<?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;
?>
<br>
</td>
</tr>
<tr>
<td style="text-align: right; font-weight: bold;">
<p1>Week:</p1>
</td>
<td>
<?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>
</tr>
<tr>
<td colspan="3" rowspan="1" align="undefined"
valign="undefined">
<hr noshade="noshade">
<div style="text-align: right;"><input
value="Reset Form" type="reset"> <input
name="submitok" value=" OK " type="submit"> </div>
</td>
</tr>
</tbody>
</table>
</form>
</div>

<!-- Current Session Variables:
$_SESSION['Year']
$_SESSION['League']
$_SESSION['Week']
-->

</body>
</html>

[/PHP]

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


SHOverine
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]
<?php session_save_path("/xxxxxx/");
session_start(); ?>

--SOME HTML Code--

<?php //Sets Season to current season

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

?>
[/php]

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.