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 Quote Link to comment Share on other sites More sharing options...
logu Posted September 1, 2006 Share Posted September 1, 2006 Can you post u r code Quote Link to comment 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"> Quote Link to comment 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 :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.