Solved

Remote user login

Posted on 1998-08-26
2
172 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to count json data 2 75
Make a file test.vbs using vbscript 5 69
Linux Scripting 3 120
Renaming multiple file extensions using Powershell 4 45
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

813 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

13 Experts available now in Live!

Get 1:1 Help Now