Solved

Remote user login

Posted on 1998-08-26
2
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
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 …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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…

738 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