if (basename($_SERVER['[HTTP_REFERER]']) == 'clientsadd.php') { //do this }