My script

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
Soccerguy12
-


Joined: 04 Nov 2003
Posts: 2

PostPosted: Sun Nov 09, 2003 6:16 pm    Post subject: My script Reply with quote

I really dont know perl at all and I have no way of testing my script. COuld someone possibly tell me if this would work:

#!/usr/bin/perl



if ($ENV{'REQUEST_METHOD'} eq 'POST') {

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;
}


$usr = $FORM{'usr'};
$txt = $FORM{'txt'};
$pword = $FORM{'pword'};
$date
if($usr eq "Mike" && $pword eq "mike")
{
if(unlink("Mike.html");)
{
unlink("Mike.html");
link("Mike.html");
}
else{link("Mike.html");}
open(PAGE,|"Mike.html")
print PAGE "$date;"
print PAGE "$txt;"
close (PAGE);

}
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Nov 13, 2003 3:23 am    Post subject: Re: My script Reply with quote

Soccerguy12,

This script seems to be fine. If you execute it on Abyss, you'll get error 200. This means that the script sent no output to the server which is the case. To avoid this message, add at the end these line:

Code:
print "Status: 200 OK\n\nInformation recorded";

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group