login/registration facility for website in perl/cgi
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
login/registration facility for website in perl/cgi
basically im trying to create a login/registration facility for a website where the following steps occur
where new visitors to the site can only register
returning visitors can only see a login facility
where if the above procedure goes wrong an error message comes up
or if its right then the 1st page of the site will appear
and if its a returning user there should be a tick box or something where there login details would be remembers for like an hour... so if they were to login within an hour the browser would remember...basically it will automatically redirect you to home page if logged in within same hour...
can someone help me because im a real novice but willing to learn...plz
It is very difficult to ascertain that a visitor is 'new' or 'returning'. Since the only identifying feature of a client connection may be the IP, you can only guess about whether the visitor is new. If the visitor supplies an identifying cookie, then you can know with some certainty that this is a returning visitor. IPs by themselves are not a reliable means of detecting returning visitors, since many IPs will be shared by numerous users.
I suggest you browse around on CPAN for packages that assist you in dealing with cookies and sessions.
Okay, perhaps I've overestimated where you are starting from. Have you done any CGI, PHP, or other server-side programming at all? If no, then you need to go to a basic tutorial on the subject, and start from there. A decent understanding of HTML and the fundamentals of web server operation would also be helpful.
Please clarify what level of experience you presently have, and perhaps we can be more helpful.
Oky, you've done HTML & Perl, but have you done any server-side programming; i.e. CGI? Do you understand how the web server interacts with a CGI program? If yes, then the suggestions you've been given should be starting to make sense. Your question revolves around the overall concept of authentication, session management, and CGI in general.
Unless your 'audience' is very limited, you will probably not be able to do exactly what you want. If you log in to this forum from a new host or new browser, the forum will not identify you. Your problem is exactly the same.
yep thats correct rod lol i kno wot im supose to do and all that but i dont kno how to lol well no quite did abit today..
ive got the registration page done where the user registers and the details are stored in a text file.. no in my login page i need to read from this text file to check if the user has registerd but how do i do that???
You must use something that identifies the user. The login page will likely be a form, in which the user supplies some identifying token, usually what we call an ID, or account name, or user name and accompanied by a corresponding password. When submitted, your perl code will check the supplied user ID against the registration database/file. If the user is registered, you will probably proceed with the nuts & bolts of the web site, otherwise procede to the registration page. Your registration page may issue a cookie containing user ID info. When a user returns, your CGI script that creates the login form may use it to automatically fill in the user ID text entry widget, or simply accept the cookie as full authentication, bypassing the login process. This is where the CPAN modules to manage cookies may be helpful.
Create 1 HTML page, a form that contains text entry widgets for user ID and password. You have said that you understand HTML, so this should not be a problem. I assume you have access to a web server for which you are able to create documents and CGI code.
Create 1 perl module as a CGI that reads and displays the received user ID and password. Use CGI.pm to FETCH THE VALUE OF A NAMED PARAMETER. Satisfy yourself that you are able to have a CGI script execute and extract data from a form.
If this isn't within your spectrum of understanding, then you need find a tutorial site that explains Perl in a CGI environment, and learn the basics of CGI programming. Actually, most tutorials will probably provide you with enough working code to accomplish the first steps in the process.
When you get the first script working, you will need to use the CGI.pm module to start generating HTML that composes the next page in your procedure, and probably working with COOKIES. Once you have accomplished this, you will probably be able to start seeing your own way.
When you come back here with specific questions, post some code fragments (use [C O D E] tags, please) that show where you are getting stuck. Please confirm that this is not a homework assignment.
Last edited by theNbomr; 11-16-2007 at 01:43 PM.
Reason: Fix links