July 7, 200917 yr I'm trying find out how i would go about creating a form which when filled in and submitted will save the information on a .txt file on the server i was hoping that each time information is submitted it will overwrite the previous data. its so a client can update his website without having to understand how to upload files to his server. there is a php 'includes' in the relevant page which takes the data from the text file so the client can change his opening times and special offers easily i tried googling it but most tutorials are for sending data from a form via email, if anybody could point me in the right direction it would really help me out thanks Seth
July 7, 200917 yr I'm trying find out how i would go about creating a form which when filled in and submitted will save the information on a .txt file on the server i was hoping that each time information is submitted it will overwrite the previous data. its so a client can update his website without having to understand how to upload files to his server. there is a php 'includes' in the relevant page which takes the data from the text file so the client can change his opening times and special offers easily i tried googling it but most tutorials are for sending data from a form via email, if anybody could point me in the right direction it would really help me out thanks Seth Hi Seth, something like this should do it (if you add validation etc): <?php $string = $_POST['string']; $file = fopen("text.txt","w") or exit("Unable to open file!"); fwrite ($file, $string); fclose($file); ?> <form action="#" method='post'> <input type='text' name='string' /> <input type='submit' /> </form> I got it from here: http://www.w3schools.com/php/php_file.asp Hope that helps Kirsty
Create an account or sign in to comment