473,499 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

logging to a website and data is being stored in a text file using perl

2 New Member
this is my perl script saved as login.pl
Expand|Select|Wrap|Line Numbers
  1. #!c:/perl/bin/perl.exe
  2. $basedir="c:/program files/apache software foundation/apache2.2/cgi-bin";
  3. $datafile="regstr.txt";
  4. $name=$in{'login'};
  5. $passwd=$in{'passwd'};
  6. open(FH1,"+>>regstr.txt");
  7. @input=<FH1>;
  8. print(@input);
  9. @input=($login,$password);
  10. close(FH1);
  11. print "Content-type: text/plain; charset=iso-8859-1\n\n";
  12. {
  13. chop();
  14. if($arr[1] eq $login)
  15. {
  16.  if($arr[3] eq $password)
  17.  {
  18.   print "<HTML>";
  19.   print "<HEAD>";
  20.   print "<SCRIPT>";
  21.   print "function back(form){history.back();}";
  22.   print "</SCRIPT>";
  23.   print "</HEAD>";
  24.   print "<BODY text=green>";
  25.   print "<BR><BR><BR>";
  26.   print "<CENTER><H1>Thanks your registeration is saved".$name."</H1><FORM><BR>";
  27.   print "<FORM>";
  28.   print "<BR><A HREF='http://10.199.44.116/cgi-bin/latest.html'></A><BR><BR>";
  29.   print "</FORM>";
  30.   print "</BODY>";
  31.   print "</HTML>";
  32.   flag=1;  
  33. }
  34. }
  35. }
  36. if($flag=!1)
  37. {
  38.   print "<HTML>";
  39.   print "<HEAD>";
  40.   print "<SCRIPT>";
  41.   print "<function home(form){history.back()}";
  42.   print "</SCRIPT>";
  43.   print "</HEAD>";
  44.   print "<BODY text=green>";
  45.   print "<BR><BR><BR>";
  46.   print "<H1><CENTER>Sorry your login and password does not exist.</H1><BR>";                
  47.   print "</FORM>";
  48.   print "</BODY>";
  49.   print "</HTML>"; 
  50. }
this is my html script saved as latest.html
[HTML]<HTML>
<HEAD>
<TITLE>Welcome to the website login page</TITLE>
<SCRIPT Language = "JavaScript">
function verify(form)
{
for(i = 0; i <= 3; i++)
{
if(document.forms[0].elements[i].value == "")
{
alert("Please Fill In Your " + document.forms[0].elements[i].name);
document.forms[0].elements[i].focus( );
return(false);
}
}
document.forms[0].submit();
}
</SCRIPT>
</HEAD>
<CENTER>
<TABLE Border = "4">
</TABLE>
<BR><BR><BR>
<FORM ACTION= "http://10.199.44.116/cgi-bin/login.pl" METHOD="POST">
<TABLE align=center border=5 cellPadding=5 cellSpacing=5 Size="800">
<TR>
<TD Colspan = "1" Width="40%">
<FONT Id = spl Color="Green" Size= "5">
<B>Login :</B>
</FONT>
</TD>
<TD>
<INPUT Name = "login" Size="35" Type = "Text">
</TD>
</TR>
<TR>
<TD Colspan = "1" Width="40%">
<FONT Id = spl Color="Green" Size="5">
<B>Password :</B>
</FONT>
</TD>
<TD>
<INPUT Name = "passwd" Size = "35" Type = "Password">
</TD>
</TR>
<TR>
<TD Colspan = "1" Width="40%">
<FONT Id = spl Color = "Green" Size= "5">
<B>Confirm Password :</B>
</FONT>
</TD>
<TD>
<INPUT Name = "confirm passwd" Size = "35" Type = "Password">
</TD>
</TR>
</TABLE>
<BR><BR>
<TABLE Align = "Center" Border = "0" Width = "40%">
<TR>
<TD Align = "Center" Width = "50%">
<INPUT Type = "Button" Value = "SUBMIT" onClick = "verify(this.form)">
</TD>
<TD Align = "Center" Width = "50%">
<INPUT Type = "Reset" Value = "RESET">
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>[/HTML]
Oct 4 '06 #1
0 1630

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4415
by: ben moretti | last post by:
hi i'm learning python, and one area i'd use it for is data management in scientific computing. in the case i've tried i want to reformat a data file from a normalised list to a matrix with some...
0
11519
by: Antwerp | last post by:
Hi, I'm trying to create a perl script that will log into a website (the login form uses POST), navigate to several pages, and append the (html) content parsed from those pages to a seperate log...
83
5842
by: D. Dante Lorenso | last post by:
Trying to use the 'search' in the docs section of PostgreSQL.org is extremely SLOW. Considering this is a website for a database and databases are supposed to be good for indexing content, I'd...
6
10221
by: Burkhard Schultheis | last post by:
As I wrote last week, we have a problem with a DB2 V8 on Linux. Here is what is in db2diag.log during online backup: Starting a full database backup. 2004-04-01-02.33.54.760164 ...
3
2454
by: Chris Smith | last post by:
Hola, pythonisas: The documentation for the logging module is good, but a bit obscure. In particular, there seems to be a lot of action at a distance. The fact that getLogger() can actually be a...
1
2041
by: Ryan | last post by:
I am trying to log events to SQL Server instead of the computers event log, but, although I get no errors, I have no luck. The webevents_events table is empty. I have a custom event that I am...
10
1776
by: jaleel | last post by:
Hi , i would like to reopen the issue in the post http://www.gamedev.net/community/forums/topic.asp?topic_id=418791. My scenario is like this: 1. A web application is there (being created by...
17
2726
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each...
5
2988
by: daveh551 | last post by:
What, from a high level point of view, is the difference (in Visual Studio 2005) between Website (accessed with Open Website or Create Website from the StartPage) that is an ASP.NET Website, and a...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.