I have a set of links in header.asp which is included on every page; these links have their href attribute set to whatever the current page is plus a linkID param. Sometimes the page the link references will have query string params, but other times it won't. If the current page URL contains the linkID param already I need to replace it, otherwise I need to add it to the current URL.
I am concatenating Request.ServerVariables("SCRIPT_NAME
") and Request.ServerVariables("QUERY_STRING
") into a variable pagename to get the current page URL. Unfortunately, I'm using classic ASP/VBScript.
I think I need to use reg ex but am not expert in it, especially not in classic ASP. The problem comes when I need to replace the element as the linkID param's value can vary so the simple Replace method won't work.
Any help is appreciated.