Jump to content

Archived

This topic is now archived and is closed to further replies.

jvalarta

How to get page/file name from Domain?

Recommended Posts

Is there a way to give PHP a domain and have it return the "index" page name? Seems like this would be simple, but I'm not finding a solution.

Example: [a href=\"http://www.domain.com\" target=\"_blank\"]http://www.domain.com[/a]

What I need is to have it return the default page name, like index.htm, or index.php, etc.

Help!

Share this post


Link to post
Share on other sites
[!--quoteo(post=344023:date=Feb 9 2006, 01:13 AM:name=jvalarta)--][div class=\'quotetop\']QUOTE(jvalarta @ Feb 9 2006, 01:13 AM) [snapback]344023[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Is there a way to give PHP a domain and have it return the "index" page name? Seems like this would be simple, but I'm not finding a solution.

Example: [a href=\"http://www.domain.com\" target=\"_blank\"]http://www.domain.com[/a]

What I need is to have it return the default page name, like index.htm, or index.php, etc.

Help!
[/quote]


Wheres the page located? Your server?

Share this post


Link to post
Share on other sites
No. the pages are potentially anywhere on the net (any domain name). These are client domains, and we are building a service to index their pages (site map on the fly). It works perfectly, except for the home page. So close, yet so far...

Share this post


Link to post
Share on other sites
[!--quoteo(post=353161:date=Mar 9 2006, 05:57 AM:name=jvalarta)--][div class=\'quotetop\']QUOTE(jvalarta @ Mar 9 2006, 05:57 AM) [snapback]353161[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I'm still in search of the answer to this...anyone?
[/quote]
[a href=\"http://www.php.net/manual/en/function.parse-url.php\" target=\"_blank\"]http://www.php.net/manual/en/function.parse-url.php[/a]
good luck mate use phase.

Share this post


Link to post
Share on other sites
Thanks redarrow, but this would only work if the file name was present...that's my challenge, to find the index file name only from giving PHP the domain name.

Example:

Example: [a href=\"http://www.domain.com\" target=\"_blank\"]http://www.domain.com[/a]

I need to have PHP go to that domain, and tell me what the default page name is (i.e. index.php, index.htm, or whatever it may be)

The purpose of this is to have our service tell people which page is their home/index page...our clients are very novice so we need to make this as simple as humanly possible for them.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.