Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
(I posted the question about there being any way to process forms without setting up a full Web server last January. See "CGI scripts without a full server?", #1335. I want to have locally run HTML form processing without the overhead of setting up a server or needing Internet access. The system won't let me add this to that thread, so I have to start a new one.)
Well, I'm still poking around with this idea once in a while. I've got the following setup (Windows XP): Perl is in C:\Perl\bin\perl.exe, and I have F:\forms\test.html and F:\forms\cgi-bin\zzzzz.pl. ".PL" is associated with Perl, so if I type "zzzzz.pl x=y" on the command line, script zzzzz.pl will run under Perl.
test.html (adapted from Elizabeth Castro's "HTML for the World Wide Web, 5th Edition"):
[html]
[head]
[title]test standalone forms[/title]
[/head]
[body]
[form method="get" action="cgi-bin/zzzzz.pl"]
[p]Name: [input type="text" name="visitor_name" size="30"/][/p]
[p]E-mail: [input type="text" name="visitor_email" size="30"/][/p]
[p]Computer: [input type="radio" name="computer" value="Mac"/]Macintosh
[input type="radio" name="computer" value="Win"/]Windows[/p]
[p][input type="submit" name="submit" value="Send info"/][/p]
[/form]
[/body]
[/html]zzzzz.pl (adapted from Elizabeth Castro's "HTML for the World Wide Web, 5th Edition"):
# if needed, perl.exe is at c:\perl\bin
use strict;use CGI ':standard';
my @param=param();#print "Content-type: text/html\n\n";
print "[html]\n[head]\n[title]zzzzz.pl[/title]\n[/head]\n[body]\n";
foreach my $name (param()) {
my @value= param($name);
print "[p]The field with the NAME attribute equal to [b]$name[/b] had a VALUE equal to [b]@value[/b][/p]\n";
}
print "[/body]\n[/html]\n";In Netscape 7.2 (Mozilla), I open file "test.html" and get the form. I fill it in and press the "Send info" (submit) button. What happens next is that the Perl file source pops up in the browser. The URL (address line) in the browser shows
file:///F:/forms/cgi-bin/zzzzz.pl?visitor_name=Phil&visitor_email=ne%27er+you+mind&computer=Win&submit=Send+info
If I change the method to "post", it omits everything after ".pl". Putting "perl " before "cgi-bin/zzzzz.pl" just seems to confuse the browser (it says it's looking for "file:///F:/forms/perl cgi-bin...). Putting "file:///C:/Perl/bin/perl.exe " doesn't work either ("The file /C:/Perl/bin/perl.exe cgi-bin/zzzzz.pl cannot be found."). Note that the stuff starting with "?" is not valid on a Windows command line (the "&" breaks it up into separate commands).
It's sending the proper data to the proper script, but it's not executing the Perl script. Damn! I'm so close I can taste it. Is there any way to invoke that Perl script without setting up a whole server? Is there a "lite" server available that would do this? Something that would be very very easy for a customer to set up. How about a minimal C program that just handles enough of HTTP to make this run? Is that protocol simple enough and well documented enough that I could cobble up something? Can anyone recommend an open source server that I could strip down to handle this? Thanks again, Phil.

If you set the form to mail the result no server is required the contents of the form are mailed to you - no need for perl
Setting up a server in XP is dead easy use apache look at http://dslwebserver.com/
Another alternative is to use IIS - already inbuilt into XP - and process the form using ASP -
YOu can use dynamic dns from http://afraid.org

If you set the form to mail the result no server is required the contents of the form are mailed to you - no need for perl
If it's mailed to me, I can't generate a fresh page to display in the browser, can I? I'm trying to come up with an interactive system, not a one-way data dump. I'm trying to use browsers and forms so I don't have to write GUIs for dozens of platforms.
Setting up a server in XP is dead easy use apache look at http://dslwebserver.com/
Another alternative is to use IIS - already inbuilt into XP - and process the form using ASP -
This is for more than just my own XP box — I want it to run on a wide variety of platforms with minimal work on the part of my customers. Most are barely able to run a self-unpacking .exe — I don't want to have to tell them to set up and configure a Web server! It will be bad enough telling them that they have to install Perl or some other scripting language.
Thanks for the suggestions, but I don't think they're going to work for me.
Phil

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |