Solved

Too much stuff on form results.

Posted on 1997-11-06
3
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…

617 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