PDA

View Full Version : reading file contents into a textarea


g00fy
02-11-2003, 10:42 PM
hello to all,

i have posted this problem on the cgi-fourm and on my news server as well, the latter saying to solve it using js but i'm not convinced

cgi forum post:
http://codingforums.com/showthread.php?s=&threadid=14353

i am trying to read the contents of a file into a textarea that i have on the admin console of my subscribe me script. the file i want to read in is NOT url acessable and simply contains email addresses. i have no problems reading it and creating a textarea using cgi/perl but what i want is for the information to appear on the textarea i already have on my console page and not create another page.

** should i be looking at js or perl (this is obviously for the perl users among u) ?

the event is 'onclick' of a form button.

i simply want it to look into the file and display the contents one address per line in a textarea. i cant work out how to do this (with js) when the file is NOT url accessible.
the file is already defined in my cgi script, thats why i went for cgi to display it.


kind regards,

g00fy

g00fy
02-12-2003, 12:17 AM
at the risk of souding stupid,

what do i save these files as, something.asp ?

and from what i can gather they both create a new page with the textarea, is this right ?

i can actually do this with cgi. what i want to do is append the textarea to my already made console or have the textarea coded into the cgi script and append the file contents to it, the problem i have is targeting the textarea from the script.



regards,

g00fy

whammy
02-12-2003, 12:32 AM
P.S. I'm assuming for now that your server uses Perl with CGI - if this is the case, here are a couple of links I found by doing a google search ("reading text files with Perl or CGI") that seem to have very relevant information:

http://www.cgi101.com/class/ch6/text.html
http://www.juicystudio.com/tutorial/perl/files.html
http://www.greyface.com/scripts/whatisperl.htm
http://www.webmasterworld.com/forum13/page2.htm

I deleted my above posts since they weren't exactly relevant to the problem at hand. Sorry about that. :)

whammy
02-12-2003, 01:39 AM
Moderator bump. ;)