Hello,
can anyone please help me find a cgi script that opens a txt file writes something in it (well a variable from flash) and then closes the file?? its so simple but couldn't find anything all morning..........
thanks!
Printable View
Hello,
can anyone please help me find a cgi script that opens a txt file writes something in it (well a variable from flash) and then closes the file?? its so simple but couldn't find anything all morning..........
thanks!
Here's a quick one that writes name and score to "score.txt":
Code:#!/usr/bin/perl -w
use strict;
use CGI;
my $cgi = new CGI;
# The file you want to write to. (chmod 777 score.txt)
my $file = "score.txt";
# Print the correct header.
print "Content-type: text/html\n\n";
# Open the file in appen mode
open(OUT, ">>".$file) or die "Error opening file : $!";
# Append the score to the list:
print OUT "Name:".$cgi->param('name').":Score:".$cgi->param('score')."\n";
close OUT;
print "wrote_score=yes";