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.
Simple URL Parser
Moderator: General Moderators
Re: Simple URL Parser
Don't use PHP_SELF - it's not guaranteed to be set. Use REQUEST_URI instead.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Simple URL Parser
ok, thanks. Don't think that code was working anyway.
Re: Simple URL Parser
Maybe this could be fixed by adjusting your rewriterule.