Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-31-2003, 11:22 PM   #1
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
Old 05-31-2003, 11:37 PM   #2
mrthumbs
salad tossing sig guy
 
mrthumbs's Avatar
 
Join Date: Apr 2002
Location: mrthumbs*gmail.com
Posts: 11,702
the script should work.
However it will generate an error when requesting it
through your browser since there is no output defined.
mrthumbs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-01-2003, 01:24 AM   #3
Hell Puppy
Confirmed User
 
Join Date: Oct 2002
Location: Hotlanta, Georgia
Posts: 183
Two tips:

1) first output to the browser from any perl cgi script needs to be something like this:

print "Content-type: text/html\n\n";

2) when you get a 500 error in the browser, go look at the webserver's error log. it'll usually tell you what the perl error was including the line number.
Hell Puppy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.