|
Posted by sunbum on 09/14/05 20:27
Sorry for replying to my own post.
Here is the latest version and I think it's closer.
Can someone help me clean up the syntax?
Thanks!
------- Code begin (this is NOT in the script ------------------
<?php
if (isset($_POST['file']))
{
// process the data, see if it's valid.
// if it's valid and you're satisfied, do whatever you want with
the data
// if not, start outputting the form
$file = "/inetpub/wwwroot/templogs/"+$_POST['file'];
// Display the Graph
displaygraph();
}
else {
// display the form
displayform();
}
<?php
function displaygraph() {
echo "So far so good, this would draw graph with $file";
}
?>
<?php
function displayform() {
<form name="cooler" action="<?php $server['PHP_SELF']?>"
method=\"post\">";
$dir = "/inetpub/wwwroot/templogs/";
echo "<select name='file'>";
$dir = opendir($dir);
while (false !== ($file = readdir($dir))){
if (in_array($file, array(".", ".."))) continue;
print "<option value='$file'>$file</option>";
}
</select>;
<input type="submit" value="Submit">;
</form>
}
?>
?>
------- Code end (this is NOT in the script ------------------
Mike
Navigation:
[Reply to this message]
|