Jump to content

PHP Script Help


fansphp

Recommended Posts

Hi All,

 

I require your help. I have a domain name and there are around 100 links inside the domain name, for example, www.domain.com is the domain name and links are like this www.domain.com/1/123/ and www.domain.com/3/456

 

I am creating 100 subdomain on my domain name and what i require is that, there will be only 1 common index page of all the subdomain, when somebody goes to 1.domain.com it will take him to that index page, in that index page, it see the subdomain and and opens the include of the coressponding links. For this heres an example,

 

if somebody goes to 1.domain.com it opens the index page,  in index page theres a code, in the code it sees that for 1.domain.com it should put the php include link as www.domain.com/1/123

 

I am not sure about the code,

 

<?php

echo $_SERVER['SERVER_NAME'];

?>

 

where i think server_name is subdomain.domain.com it than runs a query SELECT links FROM content WHERE subdomain = '$_SERVER[sERVER_NAME]'

 

Please help me with this code. Or is there any other way to do it, so that in only 1 page, it understands the subdomain name and open the corresponding site,  But there should be different Title for each of this pages.

 

Thanx

Link to comment
https://forums.phpfreaks.com/topic/157714-php-script-help/
Share on other sites

Here is the question in simple language,

 

My Domain Name has many links which is very lengthy, i am creating subdomains for each links, all the subdomains will open a page where the links just opens up inside(using the php include command), i am not redirecting it, as these subdomains will have their individual titles too,  what i want is instead of creating seperate individual index pages for each subdomains, i will creating a common index page, when somebody opens any of these subdomains, it opens that index page and inside that index page a query runs where it see the subdomain name and open the respective page with the corresponding Title.

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831829
Share on other sites

I think the question is

 

1. Someone goes to one.domain.com

2. How do you grab the "one" and do a query to grab the links for anyone that goes to "one".domain.com, because someone going to "two".domain.com would receive a different set of links.

 

mod rewrite would probably be easiest, because then you could have it specified via path and string...

 

I'm guess if that's what you are looking for.

 

Link to comment
https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831871
Share on other sites

I gave you the answer earlier...

 

Did you understand the matter, than please help me with the code which i can put on that index page, or if i have to create a sql table and run a query on that index page.

 

Please tell me what you understood, so that i can explain you. Really sorry for my bad english

Link to comment
https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831879
Share on other sites

I think the question is

 

1. Someone goes to one.domain.com

2. How do you grab the "one" and do a query to grab the links for anyone that goes to "one".domain.com, because someone going to "two".domain.com would receive a different set of links.

 

mod rewrite would probably be easiest, because then you could have it specified via path and string...

 

I'm guess if that's what you are looking for.

 

You have actually understood to what i am looking for. Can you help me with this, the code.. Thanx alot

Link to comment
https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831891
Share on other sites

Archived

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

×
×
  • Create New...

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.