IT.COM

Text file retrieval

Spaceship Spaceship
Watch
Impact
0
Someone earlier asked me how they could retrieve everything from a text file and put it as the default text for a TEXTAREA form thing. For example, get the text from message.txt and place it in
Code:
<TEXTAREA NAME="textarea" ROWS="5" COLS="40" WRAP="physical">text from text file here</TEXTAREA>
Does anyone know how to do this so it is safe with most versions of PHP?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
fopen?
PHP:
<?php
$handle = fopen ("/home/rasmus/file.txt", "r");
?>

then echo $handle, the R denotes that the file is being opened for read only or you can try this way

PHP:
<?php include("file.txt"); ?>


:)
 
0
•••
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back