2
   

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/Embed
Type: Discussion • Score: 2 • Views: 451 • Replies: 1

 
Post: # 466,980
View Profile 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

I'm the developer - Discussion by Nick Ashley
how to earn money in internet - Discussion by rizwanaraj
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
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
mod rewrite for a different theme? - Discussion by etali
 
  1. able2know
  2. » PHP: Display Domain Name
Copyright © 2009 Horizontal Verticals :: Page generated in 0.33 seconds on 11/23/2009 at 11:31:24 Top End