I'm looking for a CGI script that creates an Admin section where you can basically write a blurb and click submit and have it write over a .txt file. Simple right? why can't I find one?
Thanks!
------------------
"That's Right, I Said It,"
Printable View
I'm looking for a CGI script that creates an Admin section where you can basically write a blurb and click submit and have it write over a .txt file. Simple right? why can't I find one?
Thanks!
------------------
"That's Right, I Said It,"
I just wrote one for you, am i nice?
Basically, it parse thru the whole form and write all the fields in the file, seperated by a # sign.Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$filename = "player.txt";
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer); # Split the name-value pairs
open (FILE, ">>$filename");
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
$value =~ s/<([^>]|\n)*>//g;
if ($value eq "Submit") { last; } else {
print FILE "$value#";
}
}
print FILE "\n";
close (FILE);
------------------
DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
UWSWA1season GP:9 G:12 A:8 Pts:20 GWG:3 +/-:-3
uwcdc.com or namgor.com
Very nice, where do I send the shareware fee to? https://www.sharkyforums.com/images/.../2005/06/5.gif
------------------
"That's Right, I Said It,"
OK Sorry, I'm not trying to be difficult, How can I clear the .txt file from the same form page as the one that submits the text?
------------------
"That's Right, I Said It,"
You want to clear the text file? Then upload a blank file https://www.sharkyforums.com/images/.../2005/06/5.gif
Otherwise you need more codes... so are you sending me the shareware fees? https://www.sharkyforums.com/images/.../2005/06/5.gif (j/k)
------------------
DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
UWSWA1season GP:9 G:12 A:8 Pts:20 GWG:3 +/-:-3
uwcdc.com or namgor.com