Retaining form variables across multiple pages
Simple Version: Hey, I have about three pages that I want to use to retain variables that were submitted from a form on the first page. How will I go about doing this?
In-Depth Version: I have three pages that I need to be able to retain form information that was submitted from the first page so that when somebody who did not originally submit the first form won't be able to access the rest of the pages unless they have the original form data stored in their session.
Here is my page setup:
Page 1: Admin login page (with the form to be processed)
Page 2: (login.php) - Processes the form and displays a news form that allows the logged-in admin to post news to the website, only if the username and password they entered matches the values I have stored.
Page 3: The result of the news form submition. Basically, a page listing the news postings from the database.
However, I have two different Page 3's (news.php and newsadmin.php). One is a regular page listing all of the news postings (a public version, if you will) and the other is an admin page that has "Delete" icons next to each news posting, letting the admin delete the items from the database but within the website.
What I want is to have it so that any public user will NOT be able to access the admin version of Page 3, unless they were originally logged in from Page 1.
I've tried messing around with storing session variables, but I'm not sure if I've been doing it correctly. Any help is appreciated.
|