Text file retrieval

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

Alpha

Established Member
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
Ok Thanks :)
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back