Perl and CGI

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentPerl and CGI

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old May 4th, 2011, 04:59 PM
Muqq Muqq is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 4 Muqq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 15 sec
Reputation Power: 0
Perl Login Script

Hello everyone. I'm new to these forums and I'm in quite a bit of situation with a class I'm currently taking so I'm going to go ahead and explain what's being asked of us and what we're working with in hopes that I may be able to find the help or direction I need to complete this project.

I'm taking a networking troubleshooting class where the instructor has assigned us a project that, in my opinion, has NOTHING to do with network TS.

TDL: He's assigned us to work on a WAMP server using EasyPHP-5.3.5.0 where we have to build a fully functioning page. None of us have ever taken advanced web page classes or know anything about perl / cgi.

The project itself is graded based on the following:

Guestbook-perl (working)
Guestbook-php (working)
Login-php (working)
Login-perl (now working) -updated
Logout-php (working)
Logout-perl (now working) -updated
Session-php (working)
Session-perl (now working) -updated
Manage Users-php (working)
Manage Users-perl

All of my PHP content is working as it was very easy to find tutorials and online references to getting PHP and MySQL to work together. However I've run into a huge snag concerning the perl and cgi scripts.

I'm finding that perl in general for authentication isn't very popular and it's difficult to find working scripts that aren't relying on a back end database such as MySQL for authentication. This is where I could really use some assistance.

The instructor is expecting Login-perl to work as such:

Authentication is verified by reading from a flat text file with the information inside it upon which a cookie is created and stored on the machine. This cookie is used to allow access to the session-perl (nothing more than a blank page that just requires the cookie to be present to view) and the manage users-perl pages.

The Manage Users page is nothing more than being able to add and remove users and their passwords from the flat text file. Both session-perl and manage users-perl must contain a script that checks for the cookie. If the cookie isn't present, the page redirects the user to the login-perl page.

The logout-perl does nothing more than destroy the cookie. I've spent weeks searching around for information along these lines but the information is very scattered and mixed. Hopefully someone here can give me some idea of where to go or how to even get started on something like this O.O

Again, I'm not a programmer and I really know nothing about perl or cgi. I can follow scripts somewhat as I read them but really have no knack for creating any of my own (and is not expected of the class). We were simply advised to search around the net for already working scripts.

I apologize for the long post but I felt the more information I could put out, the easier it would be for others to see what exactly it is that's expected of the project objective and how it's supposed to work.

Thank you all for your time and hopefully I can make some progress on this soon. I appreciate any samples or references that you may be able to provide.

Last edited by Muqq : May 5th, 2011 at 04:48 PM.

Reply With Quote
  #2  
Old May 5th, 2011, 11:07 AM
Muqq Muqq is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 4 Muqq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 15 sec
Reputation Power: 0
I've got my sesssion, login and logout scripts working perfectly and I can add users into the text file.

Does anyone have any suggestions on how I can use an array to wipe a username and password from the file and rewrite the file with the remaining data?

the txt format works as such:

user:password
theuser:thepassword

the file name is called passwordperl.txt

I need a way to view all the current users and their selective password and to be able to select to remove them. I was thinking a tickbox or drop down menu might work but I have no clue how to do this or where to even start.

Last edited by Muqq : May 5th, 2011 at 05:53 PM.

Reply With Quote
  #3  
Old May 7th, 2011, 01:01 PM
Muqq Muqq is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 4 Muqq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 15 sec
Reputation Power: 0
Okay I've found a script that can remove data, more specifically lines, from a file.

Quote:
use Fcntl qw(:flock :seek);

$sitedata="websites.cgi";

open(DAT, $sitedata) || die("Cannot Open File");
@raw_data=<DAT>;
close(DAT);

splice(@raw_data,1,1);

open(DAT,">$sitedata") || die("Cannot Open File");
flock(DAT, LOCK_EX);
seek(DAT, 0, SEEK_SET);
print DAT @raw_data;
close(DAT);


Now comes the complicated portion of being able to find a way to display my current file data on the webpage and selectively choose which user / password (line) that I want to remove and find to get that line number to post into the script so it knows what to remove

Reply With Quote
  #4  
Old May 7th, 2011, 04:47 PM
Rah Rah is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 1 Rah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 41 sec
Reputation Power: 0
It's Dennis from class.

How did you solve the logout problem?

Reply With Quote
  #5  
Old May 7th, 2011, 07:19 PM
Muqq Muqq is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 4 Muqq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 15 sec
Reputation Power: 0
Dennis, e-mail me:

jadelangel87 at hotmail

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentPerl and CGI > Perl Login Script


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap