CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Perl/ CGI (http://www.codingforums.com/forumdisplay.php?f=5)
-   -   form and CGI (http://www.codingforums.com/showthread.php?t=5046)

emma85 08-28-2002 02:28 PM

form and CGI
 
take a look at this page:
http://www.beeweeb.com/download/dlmapper2k.shtml

I like to do one of them validation forms. that is: the webuser first fills in a form with required fields, and if the form is filled with address and ph and such the user gets to download, but if not -> no download!
simple?
I can't figure it out. do I need cgi for this?
or maybe some more computer awareness...

/emma

mr_ego 08-29-2002 12:49 PM

yeah you would have to do this with CGI.

something like this

Code:

#!/usr/bin/perl

use CGI qw(param);

$name = param("name");
$phone = param("phone");

if ((!$name) && (!$phone)) {
 print "You didnt enter the fields required";
} else {
 print "Location: download.zip"; # the location of the file to be downloaded (dont worry they most likely wont see this)
 open(STORE,"store.txt");
  print STORE "Name: $name\nPhone: $phone\n";
 close(STORE);
}



All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.