Well, I've started on a script that should be able to make / edit files, but I've no clue why it doesn't work. Before, it didn't do anything, but now it deletes the file (if editing) and creates a new, empty file, and if creating plus adding text, it does the same.
Here's the script, feel free to help. _;
Files:<br>
<?
$dir = opendir("./.");
while ($file = readdir($dir)) {
echo "<a href=\"$file\">» $file</a><br>";
}
closedir($dir);
?>
Select file to create:
<form method="post">
<input type="text" name="filecreate">
<input type="submit">
</form>
<?PHP
if ($filecreate) {
fopen($filecreate,"a+");
if (file_exists($filecreate)) {
echo "File exists. WARNING.";
} else {
echo "File doesn't exist, feel free to write.";
}
echo "<form method=\"post\">
<textarea name=\"filecreatetext\" name=\"filecreate\" cols=\"100\" rows=\"20\">" ;
include $filecreate;
echo "</textarea><br>
<input type=\"submit\">
</form>";
if (($filecreate) and ($filecreatetext)) {
fopen($filecreate,"a+");
fputs($filecreate,$filecreatetext);
fclose ($filecreate);
} }
?>