Solved

Members area

Posted on 2004-03-25
7
164 Views
Last Modified: 2013-12-25
I have mostly completed the databases in MySQL that store users infomration including "userid" and "password" - I can query this info from the database to make sure that an individual actually logs in on the log in page, but how do I carry over this information into all subsequent html pages? i.e. hold the log in over several pages, does this have anything to do with temporary cache and if so how do I use it?

0
Comment
Question by:Rusty20009
[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
  • 3
  • 3
7 Comments
 
LVL 12

Assisted Solution

by:venkateshwarr
venkateshwarr earned 50 total points
ID: 10681941

You may consider the option of using sessions

http://jan.netcomp.monash.edu.au/ecommerce/perl_session.html
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10687218
use CGI;
my $q = new CGI;
$q->save();
# for details see man CGI
0
 

Author Comment

by:Rusty20009
ID: 10688431
Currently, I am attempting to set a cookie - which will, I gather, be used to authenticate the user from page to page and will expire when the user closes his/her browswer, but I do not know what is happening currently with my script- no error messages but I cannot find the cookie the gets created... does this script save a cookie to the user's browser and if so how do I gather that info on a separate php page?


$mycookie = cookie(-name => 'rusteaselogin',
               -value => $rowdata[0]);
print header(-cookie => $cookie);

0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 10689666
yes the cookie is sent to the browser and stored there
you may get it back with
my $q = new CGI;
my $c = $q->->cookie('rusteaselogin');
0
 

Author Comment

by:Rusty20009
ID: 10714323
Sessions, cookies, variables and arrays, oh my!

I still have not been able to get my scripts to work.

a - create cookie with PERL
b - store cookie in browswer with PERL
c - redirect to new PHP webpage embedded within a CGI PERL script
d - use PHP to ascertain the contents of the cookie stored in "b" so as to act as a indication that user is logged in properly.

The Code:

if (($useridcheck =~ $rowdata[2]) && ($passwordcheck =~ $rowdata[3]))
{
$mycookie = cookie(-name => 'rusteaselogin',
-value => $rowdata[0]);
print header(-cookie => $cookie);

print "Content-type: text/html\n\n";
open (CGI, ">readcookie.php") || die ("File not created");
rename ("readcookie.php", "../readcookie.php");
print CGI << "HTML file";
      <html>
      <head>
      <title>Members Welcome Page</title>
      <link rel='stylesheet' rev='stylesheet' href='stylesheet.css' type='text/css'>
      </head>
            
      <body bgcolor=#E9E7DA>
      <center><br><br><br><br>
      <table width=650 border=0><tr><td>
      <\?
if (!isset(\$_COOKIE['rusteaselogin'])) :
SESSION_START();      
     echo "<br>". session_id();
else:
     echo "there is no cookie";
endif;
?>

      </td></tr></table><br><br>
      </center>
      </body>
      </html>

HTML file
close CGI;

print <<"CGI code";
      
      <html>
      <head>
      <title>Loading Results</title>
      <META HTTP-EQUIV="refresh" CONTENT="0; URL=http://www.my.net/readcookie.php">
      </head>
      <body>
      </body>
      </html>
      
CGI code
}

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10714401
> rename ("readcookie.php", "../readcookie.php");

why this?
simply do instead:

open (CGI, ">../readcookie.php") || die ("File not created");

also add at end:

close( CGI );
exit( 0 );
0
 

Author Comment

by:Rusty20009
ID: 10963618
It seems that my web hosting service does not have the CGI.pm module installed on their UNIX boxes... has caused much frustration, not to mention confusion.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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