Drupal - Settings.php that adapts to live & dev servers


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (stripos($_SERVER['SERVER_ADDR'],'192.168.1.5') === 0 ) {
  2. $db_url = 'mysqli://user:pass@localhost/dbname_dev';
  3. } else {
  4. $db_url = 'mysqli://user:pass@localhost/dbname_live';
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.