Solved

Too much stuff on form results.

Posted on 1997-11-06
3
203 Views
Last Modified: 2013-12-25
I'm using FP98 and I have a problem with form results.....
I have a site with multiple "dropdown menus" with options 0-4.(0 is default)
I have about 100 of those dropdown  menus on single form.
When I get form results I will gett every single option listed on form
results and would like to get only options that are selected 1 or higher on
my results so I would not get this huge list of info that I dont really
need. Form results would be E-mailed to my customers.
How would I need to do this?
I dont know how to program with Perl so I am unable to create my own CGI
scripts, but I would imagine it should be pretty simple script.
Any help is appreciated.
Thanks Ossi hoster19@idt.net
0
Comment
Question by:hoster19
3 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1831104
This is Javascript work, i'm afraid.

-julio
0
 

Accepted Solution

by:
p_reynolds earned 100 total points
ID: 1831105
Try this. Be sure to make it executable by typing "chmod 755 thisscript.cgi" on the UNIX command line. "thisscript" of course being whatever you call this script. Make it a plain ASCII file and save it to your cgi-bin. It's hard to write a script if I don't know: Email addresses, purpose of the form, data to be sent. This is a nice basic email form. It will parse the data from the form, test the value of each and place values greater than 0 into a single variable that will be emailed to the designated address. I hope this is a good start anyway. The best thing you could ever do if you administer a website is to learn PERL. Look at this script and figure out what's going on. Hope this helps/works!

#!/usr/bin/perl

$email = "email\@email.com";
$replyto = "replyto\@email.com";
$subject = "Automatic Email";

# Read in form data
read(STDIN,$buffer,$ENV{CONTENT_LENGTH});
# Split to name=value pairs
@pairs = split(/=/,$pair,2);
foreach $pair (@pairs) {
      ($name,$value) = split(/=/,$pair,2);
      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1)/eg;
      $FORM{$name} = $value;
}
#Now access form data as $FORM{name} (i.e. $FORM{pulldown2})

# Test the value and save the ones greater than 0 into $sendThis
foreach $pair (sort keys %FORM) {
      if $pair > 0 {
            $sendThis .= "$FORM{$pair}\n";
      }
}


open(MAIL,"| /usr/lib/sendmail $email") || die "Can't open mail!"
print MAIL "Reply-to: $replyto\n";
print MAIL "Subject: $subject\n";
print MAIL "$sendThis\n\n";
close(MAIL);

exit(0);
0
 

Author Comment

by:hoster19
ID: 1831106
P Reynolds please E-mail me at hoster19@idt.net

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question