rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <title>Testing JMOL</title> </head> <body><?phpif(!isset($_GET['file'])) { echo '<p>Select a file</p><ul>'; $d = dir('.'); while (($entry = $d->read()) !== false) { if (preg_match('/\.pdb$/', $entry)) { echo '<li><a href="index.php?file=', htmlspecialchars($entry), '">', $entry, '</a></li>'; } } echo '</ul>';} else { $file = $_GET['file']; if (!preg_match('/^[a-z0-9_.-]+\.pdb$/', $file)) { echo '<p class="error">Invalid filename passed (hacking attempt?)</p>'; } else if(!file_exists($file)) { echo '<p class="error">File ',htmlspecialchars($file), ' doesn\'t exist</p>'; } else {?> <object codetype="application/java-archive" archive="JmolApplet0.jar" classid="java:JmolApplet" height="400" width="400"> <param name="script" value="load <?php echo htmlspecialchars($file); ?>"> <param name="progressbar" value="true"> </object><?php }}?> </body></html>