-
-
Save hspencer/5dea453880ddced0fa78ef82f609f2ed to your computer and use it in GitHub Desktop.
default index.php for local development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <?php | |
| $thelist = ""; | |
| $handle = opendir('.'); | |
| if ($handle = opendir('.')) { | |
| while (false !== ($file = readdir($handle))){ | |
| if ($file != "." && $file != ".."){ | |
| $thelist .= '<a href="'.$file.'"><li>'.$file.'</li></a>'; | |
| } | |
| } | |
| closedir($handle); | |
| } | |
| $path = basename(__DIR__); | |
| $host= gethostname(); | |
| $ip = gethostbyname($host); | |
| $serverIP = $_SERVER["SERVER_ADDR"]; | |
| ?> | |
| <head> | |
| <meta charset='UTF-8'> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title><?= $path ?></title> | |
| <style type="text/css"> | |
| body{ | |
| background: rgb(36,20,99); | |
| font-family: "Avenir", "Lucida Console", Monaco, monospace; | |
| font-size: 24px; | |
| width: 90%; | |
| max-width: 960px; | |
| margin: 2em auto; | |
| color: #FFA3EE; | |
| } | |
| h1{ | |
| color: rgba(266, 66, 95, .4); | |
| letter-spacing: -.1ex; | |
| font-size: 7rem; | |
| margin-bottom: -3rem; | |
| } | |
| a{ | |
| color: #FFF; | |
| text-decoration: none; | |
| } | |
| ul{ | |
| padding: 0; | |
| } | |
| ul li{ | |
| transition: all ease 1s; | |
| list-style-type: none; | |
| padding: 5px 10px; | |
| border-radius: 3px; | |
| margin: 0 0 5px 0; | |
| font-weight: 100; | |
| } | |
| ul.main li{ | |
| background: rgba(255, 255, 255, .1); | |
| } | |
| ul.secondary li{ | |
| background: rgba(0, 0, 0, .1);; | |
| } | |
| ul li:hover{ | |
| transition: all ease 1s; | |
| margin: 0 0 5px 30px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1><?= $path ?></h1> | |
| <ul class="main"> | |
| <?= $thelist ?> | |
| </ul> | |
| <ul class="secondary"> | |
| <a href="http://<?= $ip ?>"><li><?= $ip ?></li></a> | |
| <a href="http://<?= $serverIP ?>"><li><?= $serverIP ?></li></a> | |
| </ul> | |
| </body> | |
| <html> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Default index.php for local server (localhost)