<?php include('header.inc'); ?>
<?
$fh = opendir('.');
while($file = readdir($fh)){
if(!is_dir($file)){
if($file !== "script.php" && filesize($file) > "0"){
echo "<a href=\"". $HTTP_SERVER_VARS['PHP_SELF'] ."?file=$file\">". $file ."</a> . ";
echo " <small><a href=\"$file\">View the File</a></small><br />\n";
}
}
}
if(isset($_GET['file'])){
}
else{
$fh = opendir('.');
while($file = readdir($fh)){
if(!is_dir($file)){
if($file !== "script.php" && filesize($file) > "0"){
echo "<a href=\"". $HTTP_SERVER_VARS['PHP_SELF'] ."?file=$file\">". $file ."</a> . ";
echo " <small><a href=\"$file\">View the File</a></small><br />\n";
}
}
}
}
$file = $_GET['file'];
echo "Editing File: ". $file;
$handle = fopen($file, "r+");
$page_contents = fread($handle, filesize($file));
?>
<form action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
<input type="hidden" value="<? echo $file; ?>" name="file" />
<textarea name="page_contents_updated" cols="100" rows="10"><? echo $page_contents; ?></textarea><br />
<input type="submit" value="Submit" name="submit" />
</form>
<a href="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">Go back</a> to the file listing.
<?
if(isset($_GET['file'])){
$file = $_GET['file'];
echo "Editing File: ". $file;
$handle = fopen($file, "r+");
$page_contents = fread($handle, filesize($file));
?>
<form action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
<input type="hidden" value="<? echo $file; ?>" name="file" />
<textarea name="page_contents_updated" cols="100" rows="10"><? echo $page_contents; ?></textarea><br />
<input type="submit" value="Submit" name="submit" />
</form>
<a href="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">Go back</a> to the file listing.
<?
}
elseif($_POST['submit']){
}
else{
$fh = opendir('.');
while($file = readdir($fh)){
if(!is_dir($file)){
if($file !== "script.php" && filesize($file) > "0"){
echo "<a href=\"". $HTTP_SERVER_VARS['PHP_SELF'] ."?file=$file\">". $file ."</a> . ";
echo " <small><a href=\"$file\">View the File</a></small><br />\n";
}
}
}
}
?>
$pcu = $_POST['page_contents_updated'];
$h = fopen($file, "w");
fwrite($h, $pcu);
echo "The information was updated.<br />\n";
echo "<a href=\"". $HTTP_SERVER_VARS['PHP_SELF'] ."\">Go back</a> to the file listing.";
fclose($h);
<?
if(isset($_GET['file'])){
$file = $_GET['file'];
echo "Editing File: ". $file;
$handle = fopen($file, "r+");
$page_contents = fread($handle, filesize($file));
?>
<form action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post">
<input type="hidden" value="<? echo $file; ?>" name="file" />
<textarea name="page_contents_updated" cols="100" rows="10"><? echo $page_contents; ?></textarea><br />
<input type="submit" value="Submit" name="submit" />
</form>
<a href="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>">Go back</a> to the file listing.
<?
}
elseif($_POST['submit']){
$pcu = $_POST['page_contents_updated'];
$h = fopen($file, "w");
fwrite($h, $pcu);
echo "The information was updated.<br />\n";
echo "<a href=\"". $HTTP_SERVER_VARS['PHP_SELF'] ."\">Go back</a> to the file listing.";
fclose($h);
}
else{
$fileo = opendir();
while($file = readdir($fileo)){
if(!is_dir($file)){
if($file !== "script.php" && filesize($file) > "0"){
echo "<a href=\"". $HTTP_SERVER_VARS['PHP_SELF'] ."?file=$file\">". $file ."</a> . ";
echo " <small><a href=\"$file\">View the File</a></small><br />\n";
}
}
}
}
?>