Solved

Remote user login

Posted on 1998-08-26
2
169 Views
Last Modified: 2013-12-25
How to write a cgi scripts with perl that is able to add remote user to a certain homepage?
Eg: A user need to register himself before can surf into certain homepage. How the cgi work to receive user's input and keep it at a place, then, when second time the user come again, he is able to login by entering the password that he gave when he first register.
0
Comment
Question by:sping
2 Comments
 
LVL 1

Expert Comment

by:evilgreg
ID: 1828316
Are you using .htaccess, or is it all cgi based? In other
words, is this page that is supposed to be restricted a
known URL, or is it only accessed after they have gone through
a username/password form page?

Also, what system is this on? Unix?
0
 
LVL 3

Accepted Solution

by:
johnpjohn earned 100 total points
ID: 1828317
This should do the needful and sort ur problem
TRY IT OUT
********************************************
# Three variables to keep track of the user inputs

$login=Variable1
$email=Variable2
$pagename=Variable3


# Write the login name and email address to a separate file for confirmation
# when they want to edit their page

open (FILE, ">>$data") || die "I can't open $data\n";
print FILE "$login&&$email&&$pagename\n";
close(FILE);

# Here we check the details of the user

sub checkuser {
open(FILE, "$data") || die "I can't open $data\n";      

      while(<FILE>) {
      chop;            
      @all = split(/\n/);

      foreach $line (@all) {
      ($loginname, $loginemail, $loginpagename) = split(/&&/, $line);

      if($loginname eq "$login" && $loginemail eq "$email" && $loginpagename eq "$pagename") {
            $match = 1;
            &edit($loginpagename);
                     }
            }
      
      }

#  Please add ur subroutine to open

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now