I've got a few keys (i think thats what you call them) in my web address. At the moment when i miss out a key it doesn't know what to do. How would i set it so it defaults to a certain variable.
For example i have
if i dont put the page key in i'd want it to choose page=1 automatically. And if i didn't have an id (or had the wrong id, i'd want it to default to another key (for example index.php?error=1) so i could display the appropriate error message
index.php?id=chest changes to index.php?id=chest&page=1 and index.php?page=5 or index.php?id=bananas&page=5 changes to index.php?error=1
Any ideas how i go about going this? I'm abit stumped.
I tried putting $page = 1; above the $_GET line, but that didn't change anything.
I can provide more of my code if its required.
This post has been edited by farril: 30 November 2011 - 03:20 PM