All pastes #250203 Raw Edit

Untitled

public php v1 · immutable
#250203 ·published 2006-11-16 18:54 UTC
rendered paste body
if(isset($_GET['dir'])){$dirname = $_GET['dir'];echo "<html><head><title>$dirname</title></head><body><div align=\"center\">";$dh = opendir("/home/.diplomat/kyle_osborn/hbband.com/Pictures/$dirname") or die("couldn't open directory");//open <table>echo '<table border=\"1\">';$rowcount = 0;while (!(($file = readdir($dh)) == false)) {if (!(strstr("$file", "..")) && ($file != ".")){  //if new row, open <tr>  if ( $rowcount == 0 )    echo '<tr>';	  //always open <td>  echo '<td>&nbsp;';	    //print the contents of the cell$dirname = str_replace("/","~",$dirname);if (is_dir("/home/.diplomat/kyle_osborn/hbband.com/Pictures/$dirname/$file")){      echo "<a href=\"?dir=$dirname/$file\">$file</a><br>";    } else  {		$file =  str_replace("~","/",$file);      echo "<a href=\"percent/05/$dirname~$file\"><img src=\"percent/05/$dirname~$file\"><br>$file</a><br>";    }  //always close the <td>  echo '</td>';    //if end of row, close <tr>, reset counter  if ( $rowcount >= 5 )  {    echo '</tr>';    $rowcount = 0;  }  //increment $rowcount  $rowcount++;}}//close last <tr> if it hasn't alreadyif ( $rowcount < 6 )  echo '</tr>';//close <table>echo '</table>';closedir($dh);echo "</div></body></html>";