Solved

Too much stuff on form results.

Posted on 1997-11-06
3
206 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

679 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