When I refer to the same directory on the server I mean on the live server, but if you do not have them organized this way in your local sites and create relative links they may not work as intended on the live site.
For the absolute URL it would be like your first example:
filename.php