Jump to content

Recommended Posts

Hi,

 

    I have several subdomains for my main domain. On the index.php of each sudomain, I wish to redisplay the url address but with some letters capitalized. I have the following code to get and display the url:

 

<p>
<?php 
$server=$_SERVER['HTTP_HOST'];
echo $server;
?>
</p>

 

 

For example, if a user goes to http://subdomain1.domain.com, the following is displayed on the webpage:

 

subdomain1.domain.com

 

but I want the display to be

 

SubDomain1.domain.com

 

Can anyone help?

 

Thank you,

 

SupraTT

Link to comment
https://forums.phpfreaks.com/topic/103682-solved-display-url-address-with-php/
Share on other sites

Hi Daniel0,

 

    I understand what you mean. Let me clarify what I hope to accomplish. Basically, for each subdomain, I will have a unique index.php file. Therefore, for each subdomain, I just want to take $server and I just want to retain the main domain url (I also have several main domains, domain1.com, domain2.com, ...). So the php code I wish to accomplish will get the main domain url only (domain.com not subdomain1.domain.com). I will simply append the correct formatted subdomain string.

 

Thank you,

 

SupraTT

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.