Solved

Too much stuff on form results.

Posted on 1997-11-06
3
200 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
disabled AD accounts info 3 69
Building Windows 10 1 76
User profile Size Report 3 64
Control Number of Log Files -Perl 7 55
Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
This article will show, step by step, how to integrate R code into a R Sweave document
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now