FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

very very basic php editor (only WRITING)

 


mahirharoon
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)
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
phpc0d3r
This should be in the tutorials forum.
mahirharoon
see
4th post on
http://www.frihost.com/forums/vt-85934.html
Related topics

Very basic pagination
PHP Editor
Great php editor
[Official] Best PHP Editor
PHP Editor in Frihost Direct Admin Server?

Php editor [net zoiets als frontpage]
whats the best php editor?
PHP EDITOR? What is it?
Which PHP-editor do you use?
I'd like to learn PHP and MySQL

What is the best php editor?
Is there any PHP editor like Netbeans for Java???
is there any php editor
PHP Editor's Available - FREEWARE
anyone know of a good php form processer script
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.