I have used both script name and script filename with the same results on the webhost. On my laptop server they both act as you described (correctly).
I did the $print_r['server'] on both my laptop and my host and noticed something odd on the host maybe. I won't print the whole report but here is what $server['script_name'] shows on my host...
[SCRIPT_NAME] => / [ORIG_PATH_TRANSLATED] => /home/mygob2/public_html/index.php
I wonder if there is something my host has set wierd. I am not sure what the "[orig_path...' is all about. Do you think that is effecting my results?
Thanks again for your help.