★ wanayoo — archive 1999 http://www.webdeveloper.com/drweb/19990715-drweb.htmlNouvelle recherche | Portail wanayoo
internet.com

Go to WebDeveloper Home

Seek and you shall

or search all of internet.com
Looking for a Site Map?
Vote for WD!
Please keep
voting for us
as a Top 100
Web site!

The Web Developer Network
WebDeveloper.com
Streaming Media World
WebReference.com
Web Developer's Virtual Library
BrowserWatch
Java Boutique
Web Developer's Journal
JavaScript Source
ScriptSearch
Web Developer Forums
Web Developer News

internet.com
Internet News
Internet Stocks/VC
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
E-Commerce/Marketing
ISP Resources
Downloads
Internet Resources
Internet Lists
International

Search internet.com
Advertising Info
Corporate Info
Internet Trade Shows

internet.commerce
Be an Affiliate
Be a Partner
Software Store
Computer Help
Register a Domain
Be Domain Registrar
e-solutions
Internet Jobs
A/V Network
Map Your Website
Rent E-mail Lists
Bookstore
Press Release dist.
Sell Ad Space
Internet Research
Venture Capital
Web Publishing
Build Your Intranet
Expert Tech Advice
Get e-Biz Intell.
Content for Websites

 
D R .   W E B S I T E
WebDeveloper.com

July 15, 1999

Running Perl on a PC; Forms Submissions Galore

By David Fiedler and Scott Clark
Dear Dr. Website: I am creating a search engine site using Perl. I know that 90 percent of servers are Unix-based; however, I use Win98 and want to test the program before uploading it to the site. I have ActivePerl517, I don't know how to test it on my PC. Do you just call up the file name with the browser (ex. C:/my.website.html) as you would with an HTML file? How does the browser recognize the Perl programming language on my PC only?

Even if you were running a server on your machine that could recognize Perl, such as Microsoft's Personal Web Server, Perl that's written to be used on a Unix server is not exactly the same as that written for a Windows machine. You would have to convert the Perl to work on a Windows machine, you'd need Perl to be installed on your machine, and you'd have to configure the Web server that is running on your machine to recognize Perl.

In short, you can't run valid tests without some additional work.

However, if you install Perl on your PC, you can test Perl programs in standalone mode by running them via double-clicking as usual, or calling them from the command line, something like:

C:/Perl/Perl.exe myprog.pl

Dear Dr. Website: I'm a Web applications designer, and I have one thing that is driving me crazy! That's people who get in a hurry and click the Submit button multiple times in succession, like they think it will let the computers know that they are in a hurry or something. Do you know of any way to stop this?

When Dr. Website is stumped, he knows what specialist to call on! In this case, it's Ronnie Moore, Managing Editor of JavaScriptSource.com, who gave this diagnosis:

The first, and easiest, thing to do is to add an alert() message right before the form returns true; (you are using onSubmit() with field validation, right?) This way, before the submission is sent, users have to click "OK." They aren't as likely to click again after the alert box says it's been done (or after they have moved their mouse to the OK box-which is not to say they wouldn't click ENTER).

Second, you might want to add a reset() onLoad event handler to the BODY tag that will reset each entry field to "" if they submit the form, hit Back, and try to do it again. It would clear the fields when the page loads again. People would tend not to reenter all the data.

But for a more thorough solution, we have put together a little script appropriately called "Only Submit Once." It's just a normal HTML form, with some basic field validation and submitcount checking. You can see it online at http://javascript.internet.com/forms/submit-once.html.

To test it, try submitting the form (you will have to enter data in each field), then hit "ESC" right after the alert box pops up, to stop the submission. Then, try clicking the Submit button again. Voila!

The idea behind it is this: A variable called submitcount stores a value of 0 when the page is loaded -- it is set to 0 because no forms have been submitted. When the form is submitted, the checkFields() function is called and scampers off to run some basic field validation. If all the fields validate (well...if they aren't empty), program flow comes to a nested "if...else" statement that does this:

If submitcount == 0
(a double == to test for equality, not a single = to set a value), which means that the form has not been submitted yet, and since everything validated above, it "returns true," allowing the form to submit. Right before the return true, we add 1 to the submitcount variable with submitcount++; (so now submitcount = 1).

If the user clicks again, and everything validates as normal at the top, this time in the nested "if...else," submitcount won't be equal to 0, and the else statement will run an alert message saying the form has been submitted and a "return false" to cancel the form submission.

Dear Dr. Website: I have seen banner ads that provide a text box for user input and a submit button. How is that done?

Most of the banner ads you see that use an input box and a submit button are actually created with HTML. Here is an example that we use for the WDVL (Web Developer's Virtual Library):

<CENTER>
<form method=post action="/old?u=http%3A%2F%2Fe-newsletters.internet.com%2Fcgi-bin%2Fnewslinx.form&y=1999">
<TABLE WIDTH="468" CELLPADDING="0" CELLSPACING="0" BORDER="0" BGCOLOR="#660000" ALIGN="CENTER">
<TR>
<TD COLSPAN="3"><IMG alt="" SRC="/old?u=http%3A%2F%2Fwww.webdeveloper.com%2Fdrweb%2Ft.gif&y=1999" WIDTH="1" HEIGHT="1"></TD>
</TR>
<TR>
<TD><IMG ALT="" SRC="/old?u=http%3A%2F%2Fwww.webdeveloper.com%2Fdrweb%2Ft.gif&y=1999" WIDTH="1" HEIGHT="58"></TD>
<TD>
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="466" bgcolor="#ffffee">
<TR>
<TD ALIGN="CENTER">
<A HREF="/old?u=http%3A%2F%2Fe-newsletters.internet.com%2Fwdvl.html&y=1999">
<IMG SRC="/old?u=http%3A%2F%2Fwww.webdeveloper.com%2Fdrweb%2Fwdvl-microscott.gif&y=1999" ALT="Free Newsletter!" WIDTH="58" HEIGHT="40" BORDER="0">
</A><BR><FONT FACE="Geneva, Arial, sans-serif" SIZE=-2>NEWSLETTER</FONT>
</TD><TD>
<FONT FACE="monospace" SIZE="1">
<INPUT TYPE="hidden" NAME="List_Name" VALUE="WDVL">
<INPUT STYLE="font-size:9pt;font-family:monospace;" TYPE="text" NAME="Email_Address" SIZE="8" VALUE="e-mail">
<INPUT TYPE="hidden" NAME="Action" VALUE="subscribe"><BR>
<INPUT STYLE="font-size:9pt" TYPE="submit" NAME="Subscribe" VALUE="Subscribe">
<input TYPE=Hidden Name="LAST" Value="THE_END">
</FONT>
</TD>
<TD><IMG ALT="" SRC="/old?u=http%3A%2F%2Fwww.webdeveloper.com%2Fdrweb%2Ft.gif&y=1999" WIDTH="5" HEIGHT="58"></TD>
<TD VALIGN="TOP"><FONT FACE="Geneva, Arial, sans-serif" SIZE=-1>What's new on the WDVL:</FONT><BR>
<FONT FACE="Geneva, Arial, sans-serif" SIZE="1">
<SPAN STYLE="text-decoration:none;color:blue;font-size:9pt;font-weight:normal;font-style:normal;font-family:Geneva, Arial, sans-serif;line-height:100%">

<a class="headlines" TARGET="_top" 
href="/old?u=http%3A%2F%2Fwdvl.internet.com%2FAuthoring%2FLanguages%2FXML%2FXHTML%2F&y=1999">Introduction to XHTML, with eXamples</a><BR>

<a class="headlines" TARGET="_top" 
href="/old?u=http%3A%2F%2Fwdvl.internet.com%2FAuthoring%2FHTML%2FValidation%2Fvalidate.html&y=1999">Is It Valid, or Is It Not?</a><BR>

<a class="headlines" TARGET="_top" 
href="/old?u=http%3A%2F%2Fwdvl.internet.com%2FAuthoring%2FLanguages%2FPerl%2FPerlfortheWeb%2Findex2.html&y=1999">The Perl You Need to Know, Part 2</a><BR>

</SPAN>
</FONT>
</TD>
</TR>
</TABLE></TD>
<TD><IMG ALT="" SRC="/old?u=http%3A%2F%2Fwww.webdeveloper.com%2Fdrweb%2Ft.gif&y=1999" WIDTH="1" HEIGHT="1"></TD></TR>
<TR><TD COLSPAN="3"><IMG ALT="" SRC="/old?u=http%3A%2F%2Fwww.webdeveloper.com%2Fdrweb%2Ft.gif&y=1999" WIDTH="1" HEIGHT="1"></TD>
</TR>
</TABLE>
</FORM>
</CENTER>

Visit The Dr. Website Archives.
Click here for a list of Dr. Website's most frequently asked questions (and answers!).
Send your own question to Dr. Website.

Fast Jump to Anywhere on WebDeveloper.com:



Copyright © 1999-2000 internet.com Corp.
All Rights Reserved. Legal Notices.
Contact the WebDeveloper.com staff

Last modified: Tue Jan 4 04:25:46 EST 2000

http://www.internet.com

 

Refresh Daily
Join Editor-in-Chief David Fiedler The Editor With No Time and find truth, justice, and a clue or two.


Browse by Category
[ Site Map ]

ActiveX / VBscript
Animated GIF Archive
Browsers
CGI / Perl
Database Connectivity
E-Commerce
HTML-Advanced: DHTML, CSS
HTML / Site Authoring Tools
Intranet/Groupware
Java
JavaScript
Multimedia: Audio / Video / Streaming Technologies
Opinions
Refresh Daily: Editorial Column
Security
Servers & Server Tools
Site Design / Graphics
Site Management / Marketing / Log File Analysis
VRML / 3D
XML