Last active
May 18, 2025 11:12
-
-
Save oeai/6299505 to your computer and use it in GitHub Desktop.
php display files of current folder, i'm using for motion web cam with sorting of first 77 jpg+avi this can be changed with infinite value
for ($z=$fiel;$z>0;$z--)
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
| <php> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> | |
| <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> | |
| <meta http-equiv="expires" content="0"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <meta http-equiv="pragma" content="no-cache" /> | |
| <meta itemprop="name" content="Name of Gallery"> | |
| <meta itemprop="description" content="more description"> | |
| <!-- this .gif should be transcoded to .ico just rename the png file or gif as well--> | |
| <link rel="shortcut icon" type="image/x-icon" href="some.ico" /> | |
| <title>A title on top of page</title> | |
| <style type="text/css"> | |
| <!-- a:link { color: #8F30CF} a:visited { color: #0E4BB1 } a:active { color: #CCCC33} | |
| body { | |
| color #009900; | |
| background-color #000000; | |
| margin-left 10px; | |
| margin-top 10px; | |
| margin-bottom 10px; | |
| text-align left; | |
| } | |
| --> </style> | |
| </head> <body> | |
| <table width="90%" border="0" align="center"> | |
| <tr> <td> <br> | |
| <ol id="gallery"> | |
| <H2>Motion Web Cam</H2> | |
| <h3></h3> <br> <br/> | |
| <? $dir = './'; $allowed_types=array('avi','jpg','jpeg'); | |
| $u =0; $dir_hand =@opendir($dir) or die("something curious about this broadcasting"); | |
| while ($fi = readdir($dir_hand)) | |
| { if($fi=='.' || $fi == '..') continue; | |
| $fi_pa = explode('.',$fi); | |
| $ext = strtolower(array_pop($fi_pa)); | |
| $title = implode('.',$fi_pa); | |
| $title = htmlspecialchars($title); | |
| if (in_array($ext,$allowed_types)) { | |
| $fiea[]= $fi; | |
| $u++; } } | |
| closedir($dir_hand); | |
| reset($fiea); sort($fiea, SORT_NATURAL); | |
| $fiel = count($fiea); | |
| for ($z=$fiel;$z>$fiel-77;$z--) | |
| { echo ' <a href="'.$fiea[$z].'"> | |
| <img alt="'.$fiea[$z].'"src="'.$fiea[$z].'" width="600"/></a> <br>'.$fiea[$z].'<br><br>';} | |
| ?> | |
| </ol> </div> <br> <br> | |
| </tr> <tr> <td colspan="6" align="center">© </td> </tr> | |
| </table> </body> | |
| <? |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GPL3a