start.php

post image

start.php is the most important file in TD-CMS if you remove it you won't be able to use it.

This is what "start.php" does.

  1. BASE_DIR defines the directory where TD-CMS is stored (on the server)
  2. BASE_URL defines yourdomain.co.uk or whatever your domain is
  3. ADMIN_DIR defines (BASE_DIR/admin)
  4. ADMIN_URL defines yourdomain.co.uk/admin
  5. TEMP_DIR defines (BASE_DIR/template)
  6. TEMP_URL defines yourdomain.co.uk/template

 

BASE_DIR is used to require or include a file using PHP.

BASE_URL is used for links for example: <a href="<?php echo BASE_URL; ?>/url">mylink</a>

ADMIN_DIR is used to require or include a file in the admin directory using PHP.

ADMIN_URL is used for links in the admin area for example: <a href="<?php echo ADMIN_URL; ?>/url">mylink</a>

TEMP_DIR is used to require or include a file in the template directory using PHP.

TEMP_URL is used for links for example: <link rel="stylesheet" type="text/css" href="<?php echo BASE_URL; ?>/styles.css">

 

this is how "start.php" looks like by default:

<?php

//DIR
define('BASE_DIR', __dir__);
define('ADMIN_DIR', BASE_DIR . '/admin');
define('TEMP_DIR', BASE_DIR . '/template');

//URL
if (isset($_SERVER['HTTPS'])) {
   define('PROTOCOL', 'https://');
} else {
   define('PROTOCOL', 'http://');
}
define('URL', $_SERVER['HTTP_HOST']);
define('BASE_URL', PROTOCOL . URL);
define('ADMIN_URL', BASE_URL . '/admin');
define('TEMP_URL', BASE_URL . '/template');

$start = 1;