lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LYNX-DEV CGI script 2 to set Lynx options


From: --- Alvian ---
Subject: LYNX-DEV CGI script 2 to set Lynx options
Date: Thu, 02 Oct 97 15:05:03 +1000

---Cut and save as cgi2.pl, modify path to perl & cgi-lib.pl (lines 1 & 4)---
#!/usr/local/bin/perl

# Load cgi-lib.pl and read in post-date
require ("/usr/local/etc/httpd/cgi-bin/cgi-lib.pl");
&ReadParse;

# Say something on the screen
print "Content-type:text/html\n\n";
print <<END_1;
<html>
<head><title>Lynx options updated</title></head>
<body>
Thank you for using me!<p>
Your Lynx options have been updated.<p>
The following is an echo of my output to $in{lynxrc}.<p>
END_1

# Print out options on the screen
# ---- cgi-lib.pl puts posted data in table "in".  The
#      following foreach extracts the key (index) to the
#      table, allowing me to get to all the entries.
foreach $key (keys %in) {
        print "$key=$in{$key}<p>\n" unless $key eq 'lynxrc';
        }

# Write out options to the file
open (FILE, ">$in{lynxrc}");
foreach $key (keys %in) {
        print FILE "$key=$in{$key}\n" unless $key eq 'lynxrc';
        }
close (FILE);

print <<END_2;
</body></html>
END_2
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]