Hey I was wondering if anyone could help me, I have a number of radio buttons with different values and I would like to know how to write these values to a file when they are submitted.
Announcement
Collapse
No announcement yet.
Saving submitted values from a form...
Collapse
X
-
an example would be something like this:
Code:#!/usr/bin/perl use CGI; $query = new CGI; # get data from from $text1 = $query->param("text1"); $radio1 = $query->param("radio1"); #write data to file open(OUT, ">> radio.txt") print OUT $text1 . " " . $radio1 . "\n"; close(OUT); # output result print "Content-type: text/html\n\n"; print "done";
I am not sure how perl processes radio buttons from forms. you would have to do some experimentation.
this is a crash course in processing forms with Perl. hopefully you have some scripting or programming expierence. if not, i would recommend Webmonkey's Intro to Perl for CGI or one of O'Reilly's Books on Perl. if you don't like these, a google search for Perl Tutorial could provide something useful..."There is more than one way to do it."
Comment
Comment