FULL STACK   ·   UI   ·   UX   ·   GRAPHICS   ·   DEVELOPER   ·   INSTRUCTOR

Adam Khoury

Donate funds to show love and support

Click the button below to donate funds securely online. You can use your PayPal account or a credit card.

Your donations help free up my time to produce more content and assist in covering server costs. It's also a great way to say thanks for the content!

Application Configuration

Adam will be adding options here soon.

Flat File Text Database System CMS Edit Content Tutorial

Published :
Author :
Adam Khoury
In this 2 part lesson series we demonstrate using .txt Flat File Database systems as an alternative to MySQL, XML, or other database systems. In this final part you will learn how to allow a user or client to change the data from smart easy web forms. Many people do not have tech knowledge and do not like going on the server to alter a CMS file. You must make forms to alter the data if you wish to have happier higher paying clients. <?php $myfile = "file1.txt"; if (isset($_POST['ta'])) { $newData = nl2br(htmlspecialchars($_POST['ta'])); $handle = fopen($myfile, "w"); fwrite($handle, $newData); fclose($handle); } // ---------------------------- if (file_exists($myfile)) { $myData = file_get_contents($myfile); } ?> Hello user, use this form to edit the writing on your live website <form action="file.php" method="post"> <textarea name="ta" cols="64" rows="10"> <?php echo str_replace("<br>","",$myData); ?> </textarea> <br><br> <input name="myBtn" type="submit" /> </form> <br><br> <?php echo $myData; ?>