Author Topic: php code and the VSIDO download page  (Read 473 times)


  •      v-ger
  • Posts: 3790
    • View Profile
    • VSIDO Community
php code and the VSIDO download page
« on: January 28, 2016, 02:51:05 PM »
On the VSIDO Direct download page you can see a new directory there called test_ISO's

Long story short I want to use this area to upload ISO's for testing purposes

If you click in that directory now you get a 404 error... I can work with php and know it, but it is not my strongest suit.. I need help

That directory does have the files in it now, but it does not display...

Any php folks among us who want to give it a go?

This is the .index.php file that controls that page

Code: [Select]
<!doctype html>
   <meta charset="UTF-8">
   <link rel="shortcut icon" href="./.favicon.ico">
   <title>VSIDO Downloads</title>

   <link rel="stylesheet" href="./.style.css">
   <script src="./.sorttable.js"></script>

<div id="container">
<div style="text-align:center;">
 <a href="">
<img src="" width="90" height="90" /alt="VSIDO">
<h1>VSIDO Downloads</h1>
<table class="sortable">
<th>Date Modified</th>

// Adds pretty filesizes
function pretty_filesize($file) {
if($size<1024){$size=$size." Bytes";}
elseif(($size<1048576)&&($size>1023)){$size=round($size/10241)." KB";}
elseif(($size<1073741824)&&($size>1048575)){$size=round($size/10485761)." MB";}
else{$size=round($size/10737418241)." GB";}
return $size;

// Checks to see if veiwing hidden files is enabled

 // Opens directory

// Gets each entry
while($entryName=readdir($myDirectory)) {

// Closes directory
// Counts elements in array

// Sets Date

// Sorts files

// Loops through the array of files
for($index=0$index $indexCount$index++) {

// Decides if hidden files should be displayed, based on query above.
    if(substr("$dirArray[$index]"01)!=$hide) {

// Resets Variables

// Gets File Names

// Gets Date Modified
$modtime=date("M j Y g:i A"filemtime($dirArray[$index]));

// Separates directories, and performs operations on those directories

// Gets favicon.ico, and displays it, only if it exists.
$favicon=" style='background-image:url($namehref/favicon.ico);'";

// Cleans up . and .. directories
if($name=="."){$name=". (Current Directory)"$extn="&lt;System Dir&gt;"$favicon=" style='background-image:url($namehref/.favicon.ico);'";}
if($name==".."){$name=".. (Parent Directory)"$extn="&lt;System Dir&gt;";}

// File-only operations
// Gets file extension
$extn=pathinfo($dirArray[$index], PATHINFO_EXTENSION);

// Prettifies file type
switch ($extn){
case "png"$extn="PNG Image"; break;
case "jpg"$extn="JPEG Image"; break;
case "jpeg"$extn="JPEG Image"; break;
case "svg"$extn="SVG Image"; break;
case "gif"$extn="GIF Image"; break;
case "ico"$extn="Windows Icon"; break;

case "txt"$extn="Text File"; break;
case "log"$extn="Log File"; break;
case "htm"$extn="HTML File"; break;
case "html"$extn="HTML File"; break;
case "xhtml"$extn="HTML File"; break;
case "shtml"$extn="HTML File"; break;
case "php"$extn="PHP Script"; break;
case "js"$extn="Javascript File"; break;
case "css"$extn="Stylesheet"; break;

case "pdf"$extn="PDF Document"; break;
case "xls"$extn="Spreadsheet"; break;
case "xlsx"$extn="Spreadsheet"; break;
case "doc"$extn="Microsoft Word Document"; break;
case "docx"$extn="Microsoft Word Document"; break;

case "iso"$extn="VSIDO iso"; break;
case "md5"$extn="md5 checksum"; break;
case "zip"$extn="ZIP Archive"; break;
case "htaccess"$extn="Apache Config File"; break;
case "exe"$extn="Windows Executable"; break;

default: if($extn!=""){$extn=strtoupper($extn)." File";} else{$extn="Unknown";} break;

// Gets and cleans up file size

// Output
<tr class='
<td><a href='./
$namehref'$favicon class='name'>$name</a></td>
<td><a href='./
<td sorttable_customkey='
$sizekey'><a href='./$namehref'>$size</a></td>
<td sorttable_customkey='
$timekey'><a href='./$namehref'>$modtime</a></td>

<h2><a href="" title="">VSIDO Information -</a></h2>
<h3>IRC - OFTC - #vsido or Freenode - #VSIDO<br/></h3>
<h4>For several years, VSIDO has provided a stable release cycle within Debian's SID arm <br/>with the goal of providing both the basic and the seasoned professional hacker the <br/>toolset needed to be productive, protected yet flexible enough to enjoy<br/><br/>VSIDO is built on Debian's latest to date SID kernel. Running FluxBox as the Windows <br/>Manager, any user will find just what they need to
be productive out of the box<br/><br/>Armed with Debian packages as it's base, VSIDO is a real rolling release with updates <br/>every two weeks. VSIDO also provides a <a href="" style="text-decoration:underline;"title="">support forum</a> to assist with any issues<br/><br/>Good luck with your install and enjoy VSIDO!</h4>

This is the .htaccess file

Code: [Select]
ErrorDocument 400 /.error.php
ErrorDocument 401 /.error.php
ErrorDocument 403 /.error.php
ErrorDocument 404 /.error.php
ErrorDocument 405 /.error.php
ErrorDocument 408 /.error.php
ErrorDocument 414 /.error.php
ErrorDocument 500 /.error.php
ErrorDocument 502 /.error.php
ErrorDocument 504 /.error.php

DirectoryIndex index.htm index.html index.shtml index.php default.php .index.php
AddHandler application/x-httpd-php55 .php
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+