How to get site name?

shreky - January 11, 2008 - 18:16

Hi, I am wondering how to display the sitename in my module. Any help would be greatly appreciated.

Use the site_name variable

Biteme - January 29, 2008 - 17:52

Like this:

variable_get('site_name', "Default site name")

Ehmmm... and for the site url? :)

phai - August 28, 2009 - 15:29

Hi,

I'm using Drupal 6.x and I'm searching for the website URL to use in an email notification.

I searched for it in the variables table of my database... I found site_name for the textual name of the website... but if I need the base URL?

Thank you for you help...

PhAI

Superglobal _SERVER

apaatsio - August 28, 2009 - 17:13

Would $_SERVER['SERVER_NAME'] work for you?

Thanks

phai - August 29, 2009 - 11:36

It works, but I prefer to not use server_name on a multidomain website...

However... thank for your suggestion... ;)

 
 

Drupal is a registered trademark of Dries Buytaert.