Jump to content
xisto Community
KnightEagle

Help Needed To Create Login Script With Perl/cgi Need Script

Recommended Posts

Your code if it were origionally login.cgi it is possible that it was perl but the 500 error from an apache server is a cgi program crashing you might need to set an .htaccess file in the root directory that calls the login.cgi could you show the code in a post like this snippet of perl?

first check your shebang or hash bang at the very top of the file like this

#!c:\apachefriends\xampp\perl\bin\perl.exe
If that is not set it can't find the perl.exe and won't work the above code is for my own local server Win XP Pro running Apache with Perl 5 PHP, and MySQL database server.

 

Then the rest of the code should look something like this if it is Perl

$result=$ENV{'QUERY_STRING'};&set_params;if ($logem{$result} eq "Y")  {&notification("L");}if ($email{$result} eq "Y")  {&notification("M");}print "Content-type: text/html\n\n";print "$msg{$result}\n";sub set_params{#The full path to your error log (not server log!) file.    $errorlog="c:/apachefriends/xampp/cgi-bin/birdtrap.dat";#The e-mail address of the person to notify when an error occurs.#Be sure to put the \ backslash before the \@ at sign!!!   $notify="your\@yourdomain.com";#The name of your site   $sitename="NukeXtra PHP-Nuke to the Max";#The link the reader should follow home.   $returnlink="http://nukextra/test/";#This is the URL to the directory holding your images.   $imageurl="http://nukextra/eimages";
You should be able to use the she bang of #!/usr/bin/perl/perl.exe

or#!usr/bin/perl just try that first because Perl is not html and won't work at all, the server error is probably because your shebang or hash bang is

Share this post


Link to post
Share on other sites

Well modified the shebang or what ever you want to call it. Kept changing it till it got back to the original. I have the script on Xisto server. The script I got from this site please check it out. there address is http://forums.xisto.com/no_longer_exists/ I can get the login page open just fine the instructions tell me to set all parts to what such as Step 6. CHMOD all the .cgi scripts 755 (except comm.cgi, CHMOD 644) CHMOD members.txt 666 which i did when I try the demo as user name and demo as the password it says Error: Unable to open members file. When i try to make new pasword it says Error: Unable to open members file, the file 'http://forums.xisto.com/no_longer_exists/' does not exist. but the page does. Made copys and placed it in both locations. I just dont know what to do at this point.

Share this post


Link to post
Share on other sites

Looking closely at your post I think I know why your text file can not be found. Here is the error that you quoted from the post...

 

Unable to open members file, the file 'http://forums.xisto.com/no_longer_exists/' does not exist.

That tell me that the program is looking for a file named members.txt that is in the following location http://forums.xisto.com/no_longer_exists/ (the domain) in the subdirectory of cookie_login which is a subdirectory of the cgi-bin, which to me is not normal. The file cookie_login is the name of a file that you have in your cgi-bin right? And it is supposed to get called somehow and then act on the members,txt file which in turn looks for those that have had a cookie set by the cookie_login.cgi or cookie_login.pl, but the problem here is that the cgi-bin is not part of the public_html (they are seperate directorys), you are going straight to that filein the cgi-bin which is out of the web space (public_html).

 

I do know enough about perl to see how you need to set up the file so it will work for you. I would look at possibly using a database instead of just cookies (people can turn them off) and use sessions, but of course that is up to you. I will go to the site you mentioned an see what the script is supposed to do and where you need to set the members.txt file and how to call the cookie_login.cgi or .pl.

Share this post


Link to post
Share on other sites

I'm beging to think that the site doesnt allow the use of certain scripts. I've tryed placing the members file in defferent locations and even tryed thr local area also pointed the way to the file still get the same area. Im going to have to just forget it for now. But If I cant get it to work there be no use to do anything else here. for I need the cookie to power the site so to speak. for each page reacts to the cookie as the user proceeds throught... Now does astrahost have a cookie login script that the members can place on there pages or do they allow ys to do it. I'm sitting here with my book open trying to fig what is wronge???????

Share this post


Link to post
Share on other sites

I need somebody who can take the code to a chat script I bean working on seven years ago and create a registration login, user management script for it and then COMBINE the two so not only is the chat room protected, but users have to register to chat and the registration script adds the username to the username window and database file of the chat script. The chat script is cgi driven, a webchat. I created this from several scrapts abandoned over the eyars, but really like the format... it just does not have a registration function and is useless without one. thanks!-lasvegan

Share this post


Link to post
Share on other sites

I need somebody who can take the code to a chat script I bean working on seven years ago and create a registration login, user management script for it and then COMBINE the two so not only is the chat room protected, but users have to register to chat and the registration script adds the username to the username window and database file of the chat script. The chat script is cgi driven, a webchat. I created this from several scrapts abandoned over the eyars, but really like the format... it just does not have a registration function and is useless without one. thanks! -lasvegan KnightEagle Posted Aug 31 2005, 02:36 PM Looking over the code and I think I nerrowed it down to the common file. think there is a error in the coding. Going to run it throught my editor see what I get. KnightEagle Posted Aug 30 2005, 04:03 PM I'm beging to think that the site doesnt allow the use of certain scripts. I've tryed placing the members file in defferent locations and even tryed thr local area also pointed the way to the file still get the same area. Im going to have to just forget it for now. But If I cant get it to work there be no use to do anything else here. for I need the cookie to power the site so to speak. for each page reacts to the cookie as the user proceeds throught... Now does astrahost have a cookie login script that the members can place on there pages or do they allow ys to do it. I'm sitting here with my book open trying to fig what is wronge??????? Houdini Posted Aug 29 2005, 09:48 AM Looking closely at your post I think I know why your text file can not be found. Here is the error that you quoted from the post... QUOTE Unable to open members file, the file 'http://forums.xisto.com/no_longer_exists/' does not exist. That tell me that the program is looking for a file named members.txt that is in the following location http://forums.xisto.com/no_longer_exists/ (the domain) in the subdirectory of cookie_login which is a subdirectory of the cgi-bin, which to me is not normal. The file cookie_login is the name of a file that you have in your cgi-bin right? And it is supposed to get called somehow and then act on the members,txt file which in turn looks for those that have had a cookie set by the cookie_login.cgi or cookie_login.pl, but the problem here is that the cgi-bin is not part of the public_html (they are seperate directorys), you are going straight to that filein the cgi-bin which is out of the web space (public_html). I do know enough about perl to see how you need to set up the file so it will work for you. I would look at possibly using a database instead of just cookies (people can turn them off) and use sessions, but of course that is up to you. I will go to the site you mentioned an see what the script is supposed to do and where you need to set the members.txt file and how to call the cookie_login.cgi or .pl. KnightEagle Posted Aug 29 2005, 04:49 AM Well modified the shebang or what ever you want to call it. Kept changing it till it got back to the original. I have the script on Xisto server. The script I got from this site please check it out. there address is http://forums.xisto.com/no_longer_exists/ I can get the login page open just fine the instructions tell me to set all parts to what such as Step 6. CHMOD all the .cgi scripts 755 (except comm.cgi, CHMOD 644) CHMOD members.txt 666 which i did when I try the demo as user name and demo as the password it says Error: Unable to open members file. When i try to make new pasword it says Error: Unable to open members file, the file 'http://forums.xisto.com/no_longer_exists/' does not exist. but the page does. Made copys and placed it in both locations. I just dont know what to do at this point. Houdini Posted Aug 27 2005, 06:02 PM Your code if it were origionally login.cgi it is possible that it was perl but the 500 error from an apache server is a cgi program crashing you might need to set an .htaccess file in the root directory that calls the login.cgi could you show the code in a post like this snippet of perl? first check your shebang or hash bang at the very top of the file like this CODE #!c:\apachefriends\xampp\perl\bin\perl.exe If that is not set it can't find the perl.exe and won't work the above code is for my own local server Win XP Pro running Apache with Perl 5 PHP, and MySQL database server. Then the rest of the code should look something like this if it is Perl CODE $result=$ENV{'QUERY_STRING'}; &set_params; if ($logem{$result} eq "Y") {&notification("L");} if ($email{$result} eq "Y") {&notification("M");} print "Content-type: text/html\n\n"; print "$msg{$result}\n"; sub set_params { #The full path to your error log (not server log!) file. $errorlog="c:/apachefriends/xampp/cgi-bin/birdtrap.dat"; #The e-mail address of the person to notify when an error occurs. #Be sure to put the \ backslash before the \@ at sign!!! $notify="your\@yourdomain.com"; #The name of your site $sitename="NukeXtra PHP-Nuke to the Max"; #The link the reader should follow home. $returnlink="http://forums.xisto.com/no_longer_exists/;; #This is the URL to the directory holding your images. $imageurl="http://forums.xisto.com/no_longer_exists/

;; You should be able to use the she bang of #!/usr/bin/perl/perl.exe or#!usr/bin/perl just try that first because Perl is not html and won't work at all, the server error is probably because your shebang or hash bang is KnightEagle Posted Aug 27 2005, 05:27 PM just cant get it to work quess im going to have to breack out the books and see where the problem lies. hope my red hat book or peral for dummies can help. Think I need to get the cookies working first before the members.txt page will start to work. Will load a second copy of the cookies under a diferent name so I can have a base copy to ref from in case I mess up the one Im working from. Hey houdini do you have ICQ? KnightEagle Posted Aug 27 2005, 03:15 AM the script Im using is load on Xisto I can get iyt to where you type in demo and the the password demo and then it says cant open members page. or when i go to make new user put in everything and same thing happens. getting a little tiffed at it but i will keep trying cant think of what I doing wronge. KnightEagle Posted Aug 26 2005, 04:10 AM Sence I downloaded the script from Custom.cgi which is a free web program for login use. I've been looking at what I have and it I see that there is something missing with the first just cant put my finger on it. So that explans why I'm getting the code 500. With the other from Custom.cgi I'm getting 400 or was it 404 code that I thing I need to make a link to the right page. But I'm starting to make some headway with it. Not into making any money of the site that I'm making doing it for fun. So the script I found is free just have to keep the information from them giving them credit for the code not a bad price I say. I just have to find the write code line to edit and it still work the free script doesnt come with alot of how to information. So if you could go and get it. And look at it then past what to do and where here. that could help others as well the web site is http://forums.xisto.com/no_longer_exists/ thanks for the help. I did find the line for the error page that the script shoes you when you test the login page. Thats a start I think. Houdini Posted Aug 25 2005, 04:44 PM AN http error of 500 to 505 is an internal server error, In the case of 500 it is and Internal Server Error. This code indicates that a part of the server (for example, a CGI program) has crashed or encountered a configuration error. I would check your Perl program or possibly find out about the configuration of the server which is an Apache running on a unix based machine possibly linux (just a guess), there is something wrong with that script. Since you are running a server side script like Perl then that is the most probable cause of your problems, have you considered trying PHP with MySQL also available on Xisto and millions of scripts for them both? Sorry to hear you had a problem with an XAMPP install I have never had a glitch and I have been using it for going on three years now, ever since 2002 anyway. This is all no help to me i cant under stand sorry but you need to explain more

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.