473,508 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to enter data into a file from html form using perl

2 New Member
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. }b
Oct 4 '06 #1
0 1737

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

Similar topics

9
2766
by: google_nospam | last post by:
Thanks in advance for any help. I'm looking for a way to pass data from php to perl. Basically, I want to take some dynamic data from a database, mixed with user input, then reformat it to make a...
2
9577
by: ivanhoe | last post by:
All articles and tutorials I've seen on subject of forms say that if there's name and value for submit button(input tag with type="submit"), they'll get submitted along with the rest of the...
6
5827
by: Angus Comber | last post by:
Hello I can run a command as below: start www.iteloffice.com this launches my web browser and opens up the url www.iteloffice.com What I want to do is open a particular web page and then...
4
16240
by: dschruth | last post by:
Hello. Can anybody solve this problem? I am using a server-side language (PERL) to *try* to POST data to a HTTPS login script that doesn't have a standard "submit" button. The form appears...
23
14451
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of...
0
1633
by: supern | last post by:
this is my perl script saved as login.pl #!c:/perl/bin/perl.exe $basedir="c:/program files/apache software foundation/apache2.2/cgi-bin"; $datafile="regstr.txt"; $name=$in{'login'};...
6
24239
by: greg_e | last post by:
Is there a way to create a form in a local html file where the contents of the form are written to a local file when a 'save' button is selected? It would be nice if it was as easy as changing...
3
7302
KevinADC
by: KevinADC | last post by:
If you are entirely unfamiliar with using Perl to sort data, read the "Sorting Data with Perl - Part One and Two" articles before reading this article. Beginning Perl coders may find this article...
4
3432
by: nitupatra | last post by:
I have perl script which will make a zip file and create a HTML form with asubmit button to send the zip file client. When user click the download button the zip file will be downloaded. But the...
0
7226
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
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7049
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
7499
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...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3199
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
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
422
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.