Root path script


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



Copy this code and paste it in your HTML
  1. //(on actual page)
  2. $dirDepth = 1;
  3. include "../_assets/includes/initialize.php";
  4.  
  5. //(on initialize.php)
  6. $rootPath = '';
  7. for($i=0; $i<$dirDepth; $i++) {
  8. $rootPath .= '../';
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.