Thread: quick php question

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    quick php question

    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...
    My Website

    "Circular logic is good because it is."

  2. #2
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    Code:
     <textarea> <? phf echo [i] insert file buffer here [/]  ?> </textarea>
    that should work.

    edit: changed it to echo
    there used to be something here, but not anymore

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    off the top of my head
    PHP Code:
    <textarea><?php @include(filename); ?></textarea>

  4. #4
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    wow that simple? haha. thanks guys.
    My Website

    "Circular logic is good because it is."

  5. #5
    I also believe you can use fopen and fgets, etc. just like you do in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. quick question (adding characters)
    By Cactus in forum C Programming
    Replies: 2
    Last Post: 09-24-2005, 03:54 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM