gnarlyhat

I have a YACG config file which is in

PHP

  ... and here's the content.

define('THIS_DOMAIN', 'sub.domain.com'); // THE URL OF YOUR SITE (NO HTTP:// OR TRAILING SLASH)
define('SITE_NAME', 'Your Site'); // SITE NAME
define('SITE_DESCRIPTION', 'Your description'); // DESCRIPTION OF YOUR SITE


My question is, I know there's should be some way to display the domain of each site. How do I put it in the config file here so that I don't need to edit the config everytime I setup a new site?

gnarlyhat

I tend to ask questions and answer them myself. I think it's a good way to

learn

   Applause

define('THIS_DOMAIN', $_SERVER['HTTP_HOST']); // THE URL OF YOUR SITE (NO HTTP:// OR TRAILING SLASH)
define('SITE_NAME', 'Your Site'); // SITE NAME


Now I have another question. I build my sites on subdomains so this config would work just right for me. Say I upload it on http://brain.domain.com
How do I define SITE_NAME so that it takes "brain" from the full http host of brain.domain.com ?

gnarlyhat

define('THIS_DOMAIN', $_SERVER['HTTP_HOST']); // THE URL OF YOUR SITE (NO HTTP:// OR TRAILING SLASH)
$self = explode(".",$_SERVER['HTTP_HOST']);
define('SITE_NAME', $self[0]);


Thank you gnarly. What would I do without you Applause

perkiset

GnarlyHat & "Cybil"

Twins separated at birth or same person?!?!

You decide!  Applause

Well done GH


Perkiset's Place Home   Politics @ Perkiset's