www.webdeveloper.com
Results 1 to 2 of 2

Thread: TextField = a text file??

  1. #1
    Join Date
    Feb 2005
    Posts
    3

    TextField = a text file??

    Hey,

    Can anyone point me in the right direction for setting a html text field to display a *.txt file?

    I dont want this to go through a database, but if it has to then so be it!

    Thanks

    Alan

  2. #2
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    example
    PHP Code:
    <?php
    $file 
    'path/to/file.txt';
    $fp fopen($file'rb');
    $text fread($fpfilesize($file));
    fclose($fp);
    ?>
    <form action="" method="get">
      <textarea id="file" name="file"><?php echo htmlspecialchars($text); ?></textarea>
    </form>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles