Varible from a domain

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
ek5932
Forum Commoner
Posts: 25
Joined: Mon Jun 28, 2004 5:55 pm

Varible from a domain

Post by ek5932 »

I have been searching all over the net for this and it has been doing my head in. I am creating a community service for people to signup to, the problem I am encountering is I can't find the way in which i want each different community to be viewed even though I know it is possible. What I want to do is be able to grab the user from the start of the domain and use that to pull all the information: eg

http://user.domain.com

each different community will be displayed depending which user is selected and obviously an error will occur for non existing users. How would I go about grabbing the user and using the same code for each differnt user.domain.com.

Any help would be great, thanks.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

two ways:
ek5932
Forum Commoner
Posts: 25
Joined: Mon Jun 28, 2004 5:55 pm

Post by ek5932 »

Weirdan wrote:two ways:
Would that actually redirect the user to the URL or would the real URL be masked? I know this website uses the way in which i want:

http://ag2.avidgamers.com/

and then when i made an account i was given the URL:

http://test.avidgamers.com/

and that is the URL which is actually shown in the URL bar while browsing the whole site.

would the method you posted above allow me to do this?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

ek5932 wrote: Would that actually redirect the user to the URL or would the real URL be masked?
It would be masked
Post Reply