View edit save text file database using PHP
View edit save text file database using PHP
View edit save text file database using PHP
. We are using fopen to open the file and fputs to save the file using PHP. There will be a form where you can edit the file and submit the changes.
//your file name here $fn = "My_File.txt"; if (isset($_POST['content'])) { $content = stripslashes($_POST['content']); $fp = fopen($fn,"w") or die ("Error opening file in write mode!"); fputs($fp,$content); fclose($fp) or die ("Error closing file!"); header('Location: ANY_FILE_TO_BE_REDIRECTED.php'); } ?> <form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post"> <textarea rows="15" cols="80" name="content">< ?php readfile($fn); ?></textarea> <br /> <input type="submit" value="Save"/> </form>View edit save text file database using PHP,
Incoming search terms:
- $_files save database php (1)
- save text to file with jquery (1)
- save next line in txt file in php (1)
- save and edit textarea as text file with php (1)
- open a text file edit then save using PHP (1)
- how to submit value of text area to database on our id in php (1)
- how to save files to database using php (1)
- how edit a database content using php (1)
- edit the database content with php (1)
- edit a file using PHP (1)
- symfony2 dynamic listbox from database (1)