Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://weblogs.asp.net/bsimser/dynamic-project-listing-for-xampp
- 1- Create file inside C:\xampp\htdocs folder and name it as "projects.php"
- 2- "projects.php" content:
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <link href="xampp/xampp.css" rel="stylesheet" type="text/css">
- <title>
- </title>
- <base target="_blank"/>
- </head>
- <body>
- <?php
- $handle=opendir(".");
- $projectContents = '';
- while ($file = readdir($handle))
- {
- if (is_dir($file) && ($file != "..") && ($file != "."))
- {
- $projectContents .= '<li><a href="'.$file.'">'.$file.'</a>';
- $projectContents .= '</li>';
- }
- }
- closedir($handle);
- if (!isset($projectContents))
- $projectContents = "No Projects";
- ?>
- <ul id="projectList">
- <?php echo $projectContents ?>
- </ul>
- </body>
- </html>
- 3- Got to index.html in "C:\xampp\htdocs\dashboard" and put the following:
- <li class=""><a target="_blank" href="/projects.php">Projects</a></li>
Advertisement
Add Comment
Please, Sign In to add comment