webstudioro has asked for the wisdom of the Perl Monks concerning the following question:
Thank you!#!/usr/bin/perl if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @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))/eg; $FORM{$name} = $value; } $path = "C:\Program Files\sambar51\cgi-bin"; open(TEST, ">>$path/text.txt") || die ("I can't write in database!"); print TEST "$FORM{'text'}\n"; close(TEST); print "Content-type: text/html\n\n"; print "OK. The text is in text.txt"; exit;
edited: Sun Feb 9 14:24:38 2003 by jeffa - code tags, title change (was: Whay?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help with writing to db file
by tachyon (Chancellor) on Feb 09, 2003 at 14:34 UTC | |
by Coruscate (Sexton) on Feb 09, 2003 at 20:40 UTC | |
by tachyon (Chancellor) on Feb 10, 2003 at 06:22 UTC | |
|
Re: Need help with writing to db file
by Cabrion (Friar) on Feb 09, 2003 at 14:25 UTC | |
by webstudioro (Acolyte) on Feb 10, 2003 at 14:00 UTC | |
|
Re: Need help with writing to db file
by tachyon (Chancellor) on Feb 09, 2003 at 14:27 UTC |