What variables do I need to use to build the exact url in the browser?
e.g. [protocol][domain][path][get params]
so I want to be able to have a variable contain http://example.com/folder/file.php?something=value
But I do not know what $_SERVER variables I can use to build this string?
You can use ‘PHP_SELF’, ‘SERVER_PROTOCOL’, ‘QUERY_STRING’ $_SERVER elements to get the full path.
to know all the available $_SERVER elements, check the following page
http://www.php.net/manual/en/reserved.variables.server.php