So basically I have a page where I am receiving a post variable to use to bring up database information but then lower on the page, I have another form using the post method to go to another handling page. The problem is, that when the first page receives the post variable from the page before it, then it cannot pass on the post variable in the form at the bottom of the page.
I know the recieving the post variable on the same page as putting out a new one is the problem because whenever I load the page without giving it the post variable, even though some parts of the page screw up, the form at the bottom can pass on the POST variable.
Is there any reason you cannot recieve a POST variable and send a new one on the same php page???
Here is a diagram of the flow:
-previouspage.php (passes POST variable on to mainpage.php)
-mainpage.php (page where the problem occurs, takes the POST variable from previouspage.php and uses it to pull up database information, then has another form at the bottom which sends a new POST variable to lastpage.php)
-lastpage.php (DOES NOT take the POST variable from mainpage.php unless mainpage.php did not take the POST variable from previouspage.php)
Thank you for your help in advance.
Here is the code:
php
session_start();
if (!$_SESSION['valid_user'])
{
$_SESSION['attempt']=1;
Header("Location:index.php");
}
require_once 'database.php';
$dbname = "TextbookInfo";
@mysql_select_db($dbname) or die('Database does not exist');
$user = $_SESSION['valid_user'];
$classnum = $_POST['class'];
$query= "SELECT class, bookname, isbn, requirement, notes FROM textbookinfo WHERE classnum='$classnum'";
$result = mysql_query($query);
mysql_close();
$rows = @mysql_num_rows($result);
$class = mysql_result($result, 0, "class");
echo "Books Assigned for $class<br><br>";
echo '<html>';
echo '<form name="form" method="POST" action="editclasspage.php">';
echo '<input name="hello">';
echo '<input type="submit" name="edit" value="Edit Entry">';
echo '</form>';
echo '</html>';
echo "<br><b>Links</b><br>";
echo '<a href="members.php">Back To Member\'s Homepage</a>';
?>
And just to be clear, the variable i can't get to come through to editclasspage.php is the hello variable from the second form.