Simple URL Parser
Posted: Tue Feb 17, 2009 8:26 pm
Ok, I was running into a problem with a URL in a dynamic site because the links were registering wrong when trying $_SERVER['PHP_SELF'] $_SERVER['REQUEST_URI'] and $_SERVER['SCRIPT_NAME'] due to Mod_Rewrite, so I had to manually strip the URL using.
$url=parse_url($_SERVER['PHP_SELF'],PHP_URL_QUERY);
Which has worked so far.
P.S. ['PHP_SELF'] worked until a variable was appended to the end, then it kept adding variables, (rather than the URL without the variables). Oh well, it works now unless someone else has a better solution.
Take care.
$url=parse_url($_SERVER['PHP_SELF'],PHP_URL_QUERY);
Which has worked so far.
P.S. ['PHP_SELF'] worked until a variable was appended to the end, then it kept adding variables, (rather than the URL without the variables). Oh well, it works now unless someone else has a better solution.
Take care.