Hey
I'm have page that when it loads display all the records from a mysql database that contain the value "kitchen" in the field "department". I have a link called home and when its is clicked I want this to change so it display all records from the database with the value "garden" in the field "department". Is there a way to make a variable change when a link is clicked (<a> tag)?
Thanks for any help.
change variable when link is clicked
Moderator: General Moderators
Re: change variable when link is clicked
A link just loads a PHP page. If you can make a script do what you want then all you have to do is point the link to it.
Recommendation: since this is like a search form, put the value you want in the URL (like page.php?department=garden) and use $_GET to access it. Then search on that term.
Recommendation: since this is like a search form, put the value you want in the URL (like page.php?department=garden) and use $_GET to access it. Then search on that term.