View Single Post
Old 05-31-2003, 11:22 PM  
xxxman2
Registered User
 
Join Date: May 2003
Posts: 61
My first perl script... can one can help!

Hi , I am newbie, I just wrote my first script, but it's doesn't work, the error message is "500 Internal Server Error".
My script calls a script on other server, any ony can help to find out what's error,
I really appreciate your help, thank you!

-----------------------------------------------
#!/usr/bin/perl

$siteid= 'xxxx';
$sitepass= 'xxxx';
$lognm= "xxxx";
$passfile= 'xxxx';
$webemail= '[email protected]';
$sitename= 'xxxx';
$contenturl = 'http://www.contenturl.com/';
$webid = $siteid;
$webfile = 'xxxx';
$reqtype = 'XXXXX';
$username=$FORM{'username'};
$password = $FORM{'password'};
$email= $FORM{'email'};


sub readduser () {
my $addscript = 'http://www.otherserver.com/cgi-bin/add.cgi';
my $query = "siteadd=all&"."webfile=".$webfile."&"."reqtype=". $reqtype."&"."webid=".$webid."&"."passfile=".$pass file.
"&"."webemail=".$webemail."&"."sitename=".$sitenam e."&"."lognm=".$lognm."&"."expire=999999999&"."con tenturl=
".$contenturl."&"."paymentmethod=".$sitename."&"." eml=".$email."&"."username=".$username."&"."passwo rd=".$password;
my $h = new HTTP::Headers;
$h->referer("http://www.mydomain.com/cgi-bin/");
$h->user_agent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; .NET CLR 1.0.3705)');
$h->authorization_basic($siteid, $sitepass);
my $req = HTTP::Request->new(POST => $addscript, $h);
$req->content_type('application/x-www-form-urlencoded');
$req->content($query);

my $ua = LWP::UserAgent->new;
my $res = $ua->request($req);
my $result = $res->as_string;
if ($result =~ /added/si) {
print "[$key] readded.\n";
}
}
----------------

Last edited by xxxman2; 05-31-2003 at 11:41 PM..
xxxman2 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote