a simple php editor (can be used for any programmimg languages or text files)
note : this is open source (i will aprecciate linking to my web site (mahirharoon.frihost.net) so please don't distribute this whithout any permission
the code
1-index.html (submits querys)
2-process.php (processes the query and does it)
(i used $get because it is dpending on url so server load will be minimized)
Last edited by mahirharoon on Mon Jan 14, 2008 9:07 pm; edited 1 time in total
note : this is open source (i will aprecciate linking to my web site (mahirharoon.frihost.net) so please don't distribute this whithout any permission
the code
1-index.html (submits querys)
| Code: |
| <html>
<form action="process.php" method="get"> Name: <input type="text" name="fname" /> <p> content: </p> <div> <textarea name="content" rows="20" cols="40"> <?php ?> </textarea> </div> <input type="submit" /> </form> <html> |
2-process.php (processes the query and does it)
| Code: |
|
<?php $filename = $_GET["fname"]; $somecontent = $_GET["content"]; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?> |
(i used $get because it is dpending on url so server load will be minimized)
Last edited by mahirharoon on Mon Jan 14, 2008 9:07 pm; edited 1 time in total
