Computing.Net > Forums > Web Development > HTML forms without a full server?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

HTML forms without a full server?

Reply to Message Icon

Name: Phil Perry
Date: December 30, 2005 at 17:01:53 Pacific
OS: Win XP Home
CPU/Ram: P4/256MB
Comment:

(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.



Sponsored Link
Ads by Google

Response Number 1
Name: rayok123
Date: December 31, 2005 at 00:38:56 Pacific
Reply:

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


0

Response Number 2
Name: Phil Perry
Date: January 2, 2006 at 17:58:51 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: HTML forms without a full server?

CGI scripts without a full server? www.computing.net/answers/webdevel/cgi-scripts-without-a-full-server/1335.html

setting up a FTP server www.computing.net/answers/webdevel/setting-up-a-ftp-server/733.html

2 action attributes in a HTML form? www.computing.net/answers/webdevel/2-action-attributes-in-a-html-form/2413.html