<?php
/* if the "submit" variable does not exist, the form has not been submitted - display initial page */
if (!isset($_POST['submit'])) {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input name="File" size="15">
<input type="submit" name="submit" value="Go">
</form>
<?php
}
else {
// open file
$fh = fopen($File, 'r') or die('Could not open file!');
// read file contents
$data = fread($fh, filesize($File)) or die('Could not read from file!');
// close file
fclose($fh);
// get detail
// print file contents
echo "<img src=\"$File\">";
}
?>
the concept is simple: gets an input in the form then outputs the corresponding picture of the same name.
Doesn't work, I have no idea why, plus the fact that I'm having difficulty testing it.. (slow net connection = 30++ second waits between testing).