I create a perl script (over Windows XP platform) and my script not write a data base. Whay?
------------------------------
#!/usr/bin/perl
# Get the form variables
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
$buffer = $ENV{'QUERY_STRING'};
}
else {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}
# Break em up into a format the script can read
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/e
+g;
$FORM{$name} = $value;
}
$path = "C:\Program Files\sambar51\cgi-bin";
open(TEST, ">>path\textNX.txt");
print TEST "$FORM{'text'}\n";
close(TEST);
print "Content-type: text/html\n\n";
print "Textul a fost adaugat in textNX.txt";
exit;
-----------------------------------------
I use sambar server. Please help me.
edited by boo_radley : code tags added, moved to SOPW.