Hosting Solutions
mobile_logo Table of Contents

Flat File Text Database System CMS Edit Content Tutorial

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; ?>

PHP Videos


Website Design Theme Application PHP Cookies CSS TutorialPDO Prepared Statements PHP TutorialPDO Tutorial Connect Database and Query ExampleActive Page Link Button Highlight TutorialGeoPlugin Tutorial Get User Location Information IP DetectionHashtag System and Regex PHP Programming TutorialPagination MySQLi Google Style Paged Results TutorialActive Clickable Link Function preg_replace Programming TutorialGet Favicon From Web Site Link Access External FilesRandom String Generator PHP Function Programming TutorialForce File Download Dialog In Browser TutorialCheck User Sign Up Name Ajax PHP Social Network TutorialFlat File Text Database System CMS Edit Content TutorialFlat File Text Database System Display ContentExperience Level Evaluation Programming TutorialStagger and Limit Dynamic Output in a While Loop Google AdsTwitter Dynamic Goodies Widget TutorialDynamic Google Maps Location TutorialPrepared Statements PHP mysqli Tutorial