/    Sign up×
Community /Pin to ProfileBookmark

How do I fill a Terxtarea with data from a file

Anyone know how to fill a ‘textarea’ with data from a .txt file

or how do I get this data into a box on the screen leaving room to add further data.. (much like a chat box does)

cheers…

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@CharlesJun 26.2006 — [code=php]<textarea><?php include ('some-file.txt') ?></textarea>[/code]
Copy linkTweet thisAlerts:
@glenvernauthorJun 26.2006 — Hi charles

Afraid I couldn't get that to work, it just placed the php code in the textarea not the contents of the file..?

Am I missing something.?
Copy linkTweet thisAlerts:
@dthurman1432Jun 26.2006 — Try

<textarea><!--#include file="filename.txt" --></textarea>
Copy linkTweet thisAlerts:
@dthurman1432Jun 26.2006 — If both of these don't work then you don't have server scripting capabilities. Maybe possible with Javascript? But if you a trying something simliar to a chat room, I would think you would have to be very advanced to pull something like that off. You would want to upgrade your hosting that processes server scripts and there are actual chat scripts all over the place you could use that are already set to go.
Copy linkTweet thisAlerts:
@glenvernauthorJun 26.2006 — That one didn't work either... (same thing, just placed the code in the textarea)

My host server is a payed host and offers everything under the sun, so (I think) it can't be through not having the capabilies..??

Perhaps I'm not understanding the meaning of 'server scripting capabilities'..
Copy linkTweet thisAlerts:
@dthurman1432Jun 26.2006 — Just contact your hosting service and ask if you can use asp or php scripting with your hosting plan.
Copy linkTweet thisAlerts:
@slaughtersJun 26.2006 — If you do not have server side access you can try using the text file as the src of an iframe.

If it must be in a <textarea> tag, then just hide the iframe and assign it's innerText to the textarea's value.
Copy linkTweet thisAlerts:
@kiwibritJun 26.2006 — Don't forget to change the file extension to php, or [url=http://www.spiderpro.com/bu/buphph001.html]set up your .htaccess file[/url] - assuming your host is using an Apache web server - if you wish to use php includes in an html file.
Copy linkTweet thisAlerts:
@timmahJun 26.2006 — are you using an editor like dreamweaver/frontpage - if so it converts the < and > signs to &lt &gt or whatever... you have to insert those lines in plain text/code view/notepad. you might also need to rename your file .php or .shtml depending on the example you are trying
×

Success!

Help @glenvern spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...