i have a subscribe me (perl) script and i am trying to read the contents of my subscribers database file into a textarea that is on my admin console. i.e., i want it all to appear on the one page,
my db file is not url accessable but is already defined as "$memberinfo/address.txt", where it is an absolute path to the file.
this is my code but i get server errors,
i tried having the textarea already on the page and append the contents to it, but i didnt know how to target the textarea
and i dont know how to append a textarea to a page once the page is created.
<form action="&addresses" method="post" name="email_butt" id="email_butt">
<input type="submit" name="Submit" value="Show Subscribers">
</form>
sub addresses{
open (ADDR,"<$memberinfo/address.txt");
@addr = <ADDR>;
close(ADDR);
print <textarea name="address" cols="50" rows="10" wrap="OFF" id="address">
foreach $line (@addr)
{
print "$line";
}
print </textarea>
}
if ths is impossible i am quite happ to have the subscribers appear within a textarea on another page :(
thanx to all
knid regards,
g00fy
Be sure to read Marcia`s WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com] post.
Do it like this:
print [perldoc.com] <<END; # just a nice way of quoting: heredoc style
<html code>
END
#
open [perldoc.com] 'ADDR', "<$memberinfo/address.txt"
or die [perldoc.com] "Can't open file: $!\n";
print [perldoc.com] <ADDR>; # print out the whole file
close [perldoc.com] 'ADDR';
#
print [perldoc.com] <<END; # your html code
</html code>
END
Andreas
<form action="&addresses" method="post" name="email_butt" id="email_butt">
<input type="submit" name="Submit" value="Show Subscribers">
</form>
</div></td>
</tr>
</table>
EOF
&footer2;
&footer;
exit;
}sub addresses{
print <<END
<html>
<head>
<title></title>
</head>
<body>
<CENTER><BR>
<TABLE BORDER="0" WIDTH="400">
<TBODY>
<TR>
<TD>
<textarea name="address" cols="50" rows="10" wrap="OFF" id="address">
END
#
open 'ADDR', "<$memberinfo/address.txt" or die "Can't open file: $!\n";
print <ADDR>;
close 'ADDR';
print <<END;
#
</textarea>
</TD>
<TR>
</TBODY>
</TABLE>
</CENTER>
</body>
</HTML>
END #
}
this returns a 404 error to me but other parts of the form accept this var ($memberinfo/address.txt) without a 404