sesstreets Posted September 1, 2006 Share Posted September 1, 2006 Im trying to write a script that will:1. Open a file and display the files content into an editable box.2. On the press of a submit button, it will update the file.How do I do this? Ive tried fopen and get_file_contents but neither really works Link to comment https://forums.phpfreaks.com/topic/19324-bit-confused-how-should-i-update-a-file/ Share on other sites More sharing options...
logu Posted September 1, 2006 Share Posted September 1, 2006 Can you post u r code Link to comment https://forums.phpfreaks.com/topic/19324-bit-confused-how-should-i-update-a-file/#findComment-83851 Share on other sites More sharing options...
extrovertive Posted September 1, 2006 Share Posted September 1, 2006 <?php$file = 'my/path/file'; if(isset($_POST['submit']) { $filestring = $_POST['filestring']; file_put_contents($file, $filestring); } $filestring = file_get_contents($file);?><form action="" method="post"><textarea name="filestring">echo $filestring</textarea><input type="submit" name="submit" value="Submit"> Link to comment https://forums.phpfreaks.com/topic/19324-bit-confused-how-should-i-update-a-file/#findComment-83853 Share on other sites More sharing options...
techiefreak05 Posted September 1, 2006 Share Posted September 1, 2006 do you get any erros? or does it just do nothing.. i dont see whats wrong.. hhmm.. i shall look harder :-) Link to comment https://forums.phpfreaks.com/topic/19324-bit-confused-how-should-i-update-a-file/#findComment-83876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.