how to get the previous url of the page in php code example Example: how to get previous page name in php basename($_SERVER['HTTP_REFERER']);