1
   

PHP: Display Domain Name

 
 
Reply Wed 26 Nov, 2003 03:29 pm
How would I display the domain name of the page I am at. Lets say it is www.domain.com/something.html and I want to display domain.com. Exactly like that. No www, or http:// included.

I have tried
Code:<?php echo htmlentities( $_SERVER['REQUEST_URI'] ); ?>

but it does not quite work.

The code above displays a frontflash '/'. And not the domain.extension.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 1,237 • Replies: 1
No top replies

 
venom
 
  1  
Reply Wed 3 Dec, 2003 04:32 pm
Try changing it to this i havnt tried it yet but it should work

Code:<?php echo htmlentities( $_SERVER['REQUEST_URL'] ); ?>
0 Replies
 
 

Related Topics

In How much time a website can be developed? - Question by aussiejumpingcastle
Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » PHP: Display Domain Name
Copyright © 2021 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 06/14/2021 at 04:04:09