In a nutshell on \"page1.php\" I have a calculator that consists of an HTML form, and then the PHP code totals the input and displays the total price. Below the price, it al
PHP is stateless unless you save things in session (which isn't secure right?)
You would need to make page2.php read all the values from page1.php and store them either in a server side state (session) or a client state (cookies or maybe hidden fields in the form)
If you want any of this secure or a secret, then you have to consider all of that as well. Nothing I explained is secret or secure in any way.
EDIT: here is an example of page1.php that sends the values of page1.php to page2.php as get parameters. You can do this with hidden fields, cookies or sessions as well.
What is important to remember is that page2.php is totally unaware of page1.php, and can't get to the values like you could it forms programming. Each page starts and ends it's life by the time you see a full web page, so you have to use some extra tricks to keep values. Those tricks are sessions, cookies, form posts, or gets.
Page 1
";
}
if($submit == "submit" )
{
//go to page two, with the total from page1.php passed as a $__GET value
header("Location: page2.php?total=".$total);
}
}
?>