How do I get the full URL of the current page?
Have you tried using request_uri()?

$_SERVER['HTTP_HOST'] . request_uri();


It should do the trick. I haven't tried it myself, and I may be off a bit, but I suggest you give a try.
From JavaScript, you could use the window.location.href variable.