aboalkhair

Dynamic Project Listing for XAMPP

Jan 9th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. https://weblogs.asp.net/bsimser/dynamic-project-listing-for-xampp
  2.  
  3.  
  4. 1- Create file inside C:\xampp\htdocs folder and name it as "projects.php"
  5.  
  6. 2- "projects.php" content:
  7.  
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <link href="xampp/xampp.css" rel="stylesheet" type="text/css">
  12. <title>
  13. </title>
  14. <base target="_blank"/>
  15. </head>
  16. <body>
  17.  
  18. <?php
  19. $handle=opendir(".");
  20. $projectContents = '';
  21. while ($file = readdir($handle))
  22. {
  23. if (is_dir($file) && ($file != "..") && ($file != "."))
  24. {
  25. $projectContents .= '<li><a href="'.$file.'">'.$file.'</a>';
  26. $projectContents .= '</li>';
  27. }
  28. }
  29. closedir($handle);
  30. if (!isset($projectContents))
  31. $projectContents = "No Projects";
  32. ?>
  33.  
  34. <ul id="projectList">
  35. <?php echo $projectContents ?>
  36. </ul>
  37.  
  38. </body>
  39. </html>
  40.  
  41.  
  42. 3- Got to index.html in "C:\xampp\htdocs\dashboard" and put the following:
  43. <li class=""><a target="_blank" href="/projects.php">Projects</a></li>
Advertisement
Add Comment
Please, Sign In to add comment