View Full Version : quick php question

07-29-2004, 11:22 PM
Anyone know how to take text from a file and place it in a HTML textbox using PHP?

for example i have a file called bob.dat and I want to load all the data in that file and place it in a "text area" object on an html page so the user can edit it and then save it back to the file.

saving information from the text area object to the file is easy...and loading the file is easy...i just dont know how to get the data from the file to the text area box...

07-29-2004, 11:25 PM
<textarea> <? phf echo [i] insert file buffer here [/] ?> </textarea>

that should work.

edit: changed it to echo

07-29-2004, 11:26 PM
off the top of my head

<textarea><?php @include(filename); ?></textarea>

07-29-2004, 11:29 PM
wow that simple? haha. thanks guys.

07-30-2004, 03:31 AM
I also believe you can use fopen and fgets, etc. just like you do in C