Forum Moderators: coopster
say for example: I use GET to fetch the month from the URL:
www.example.com?month=January
I store this is variable $month on the menu page....
The menu page has links like Visitors, Page Views, etc...
So when the user clicks on Visitors link, I want to send this $month variable to Visitors page....
How can i do this?
Thanks!
Alternatively, you could store the data in the SESSION array, or, a la .NET, make the page into a giant form, and use POST.
Depending on the amount of data, and other factors, you may choose to store the data in files, or in a database and pull the data as required.
Is there a way like, if the link is clicked once, use $_SESSION, but if the user enters month in the other page, use $_GET?
session_start();
$month = (isset($_SESSION['month']))? $_SESSION['month']: $_GET['month'];
This checks to see if the session variable 'month' is set and if it is, it makes $month take on that value. If not, it gets the value from the GET url query.