Finding out calling address

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Finding out calling address

Post by Stryks »

Hi guys,

Just wondering if anyone could tell me if there is any reliable way of telling what name was used to call my site.

What I am getting at is, if the site is called with my external IP addy, then I want to have all pages referred to with that addy, as opposed to my actual domain name. And vise versa.

Basically, I guess I will need to somehow capture the url used to view the current page ... not the referrer ... just the actual address in the address bar.

Any ideas? Thanks
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Not sure about this one, with a main reason as I can test-and-try this myself, but consider looking into .htaccess use (if using Apache). Might find something interesting using that file.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

[php_man]gethostbyaddr[/php_man] - doesn't always work reliably, though, but that's the only native PHP command I can think of.
Post Reply