View Full Version : Perl CGI Login/Password Scripts
genexis
11-17-2002, 11:17 AM
Hello helpful people, I'm rather new to this forum, and would like to ask of your help in a problem i face. Firstly, I am not new to perl as a programming language, i've been doing a lot of socket and server/client programming. However, recently I moved into web scripts programming, and came across this question.
How does the login/pass scripts in the different websites work ? As in, how do they recognise you after you login ? I was told that some uses invisible fields to store a 'unique' key, but then how is that key assigned to the different access levels on the server side ?
Is there any place i can read up on programming on login/pass ?
Thank you, and please try to help me.
chrisvmarle
11-17-2002, 02:46 PM
Original Private Message:
In a post (http://www.codingforums.com/showthread.php?s=&threadid=9966) I've read you are familiar with socket programming in perl (and server/client stuff).
I have a problem with this I wanted to create two script lets say server.cgi and client.cgi. Server.cgi will run on my server on (for example) port 2334 now I want client.cgi to connect to my server:2334 and exchange some information like this:
Server
Client
Hello REMOTE_IP
END
Hello back
END
Version newest
END
Version 2.14.9
END
Version current 2.14.8
END
Info Update available
END
quit
END
bye
END
My server.cgi will print text like this:
REMOTE_IP connected
REMOTE_IP greets
REMOTE_IP is asking for newest version (2.14.9)
REMOTE_IP is running 2.14.8
REMOTE_IP got info on update
REMOTE_IP is quiting
And client.cgi will print like this:
Connected
Greeting
Asking for newest verion
Newest version is 2.14.9
Sending info on current version
INFO: Update available
quiting
bye
Have you got any idea how to do this?
I've had a script that was doing pretty well as server, but I never got how to have the client wait for an "END" and then examine the part(s) before...
Please help me out!
Mzzl, Chris
genexis
11-17-2002, 04:45 PM
Well... from what i understand from your problem, you are trying to create a server, and not really a cgi script. If it is about CGI scripts, i am not too sure of how to help you, cause i am rather unfamiliar with it.
for server and client programming
i'll suggest you read up on IO::Socket handling, it is much easier then the standard Socket.pm
http://www.perlfect.com/articles/sockets.shtml
try this link.
chrisvmarle
11-17-2002, 05:30 PM
Thanks I'll give it a try :)
And about your problem, the best way to protect a site with username password combinations is with .htaccess and .htpasswd. You could search the forums or the web for this, there is very much information to be found.
A good start would be http://javascriptkit.com/howto/htaccess.shtml
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.