I have several pages that use querystrings to highlight an option in the menu, and all the page URLs contain the string expressed in tones, so the next menu option will be highlighted on the next page if the user clicks on the link.
However, the problem occurs when someone visits the page without the request included in the URL, the menu option is not highlighted.
What I would like to do is check the URL to see if the request exists if it is not created.
The URL is expressed as such www.mysite.co.uk/Folder1/Folder2/Page.php?id=3
and I would like the default string ?id=1 if it is not already specified in the url.
Any ideas on how you do this?
And what happens if a user visits via the URL www.mysite.co.uk/Folder1/Folder2/Page.php?
Will the URL be as www.mysite.co.uk/Folder1/Folder2/Page.php??id=1
or it will be www.mysite.co.uk/Folder1/Folder2/Page.php?id=1
Thanks,
url php query-string pageload
user2972392
source share