How do you pass the current page as a variable to a new page?
Read up on HTTP_REFERER, though it would be more reliable to pass it explicitly using say, PHP_SELF by one of the normal methods of maintaining state (e.g. GET, POST, COOKIE or sessions).