well there is a way 🙂
its strrchr($haystack,$needle)
so you can put this:
$refererpage = strrchr($refererurl,"/");
now $refererpage will display the: /file.php
if you want to get rid of the / then use this:
$refererpage = str_replace("/","",strrchr($refererurl,"/"));
which should display file.php
but, yes there is a but, if your using it for the current address/page that the user is looking at (btw this does include any extras like: file.php?this=that)
$refererpage = getenv("REQUEST_URI");
the code above also includes the / so you use this to get rid of the / use this:
$refererpage = str_replace("/","",getenv("REQUEST_URI"));