HTML text box input to file?

  • Thread starter Thread starter stepanstas
  • Start date Start date
S

stepanstas

Guest
I would like to make a textbox on an HTML page (it could be CSS). I wan't the data of that text box to be send to a text file. The text file will be stored locally on the same computer where the page will load from.
 
If you use serverside scripting such as php then you can.

Another way to include txt files is to call it using a javascript - like:

Put this in the body of your html:

<script language="javascript" src="text.txt"></script>

Then create a new text file in the same folder as your html file called text.txt and put this in it:

document.write('Your text file');

Open the html file in your browser and it should display the text "Your text file" (assuming you have javascript turned on).

Make sure you don't delete the document.write(''); as it will make the script not work.
 
Have the html use a form action to send the content in the text box to a php file. the php file would then open a file stream to a text file where you could write the sent content.
 


Write your reply...
Back
Top