Results 1 to 3 of 3
Related
-
making div Forum: HTML Forum
Replies: 1 -
Need help making a search script Forum: CGI Perl Forum
Replies: 7 -
Making an application Forum: Website Scripts Forum
Replies: 8 -
Making gifs Forum: HTML Forum
Replies: 2 -
Making changes Forum: HTML Forum
Replies: 6
-
09-30-2003, 10:57 AM #1
Hello, need help with a script I'm making
Hello, need help with a script I'm making.
I have setup this script and its working fine. Now I would like to take this basic script to
a new level and have it save to a HTML page instead of just a text file.
This is the basic CGI script for processing Web forms. The script will take the
information from the Web forms and save it to a tab-delimited text file, responses.txt, in
your public_html directory while printing a brief message to the Web browser.
I would like to get this script to save the info from the web form to a HTML webpage
rather then a simple text file.
If someone could help me with this I would greatly appreciate it.
Here is the basic script that I have so far.
#!/usr/local/bin/perl
use CGI;
CGI::ReadParse(*in);
$file = '../tutorial_files/responses.txt';
print "Content-type:text/html\n\n";
print '<HTML><HEAD><TITLE>saveform.cgi results</TITLE></HEAD>';
print '<BODY BGCOLOR="FF0066">';
print '<h2>Thank you for your form submission.</h2>';
print '</BODY></HTML>';
open(FILE, ">>$file")||die "Can't open $file";
flock(FILE, 2)||die "Can't lock $file";
foreach $i (keys %in) {
print FILE "$in{$i}\t";
}
print FILE "\n";
close(FILE) || die "Can't close $file";
Thanks
-
09-30-2003, 01:55 PM #2
Hiya,
I am by no means an expert on Perl (in fact, I only know how to break it) but It looks like you have most of it above already. All that remains is to output your variables to the same page (and maybe change the filename to responses.html) and it should work fine.If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
09-30-2003, 02:08 PM #3
Thanks.. I'll play with it a bit see what I can come up with.
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum