Help with code for URL paramaters

Both these examples are over complicated. I do not need a dataset, just the page to pop up the message with the query part of a URL. Anyone can provide the code rather than tutorials?