Goodies To Go! Newsletter #368

By Vince Barnes


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

Goodies to Go (tm)
December 20, 2005 -- Newsletter # 3
This newsletter is part of the internet.com network.


Featured this week:
*   Goodies Thoughts - Emailing Form Data
*   Q & A Goodies
*   News Goodies
*   Feedback Goodies
*   Windows Tech Goodie of the Week 
*   And Remember This...
Emailing Form Data
One of the most common questions our mentor community is asked concerns the use of Email Forms.  These are HTML pages that include a form in which the site visitor can enter some information and send it via email to the intended recipient.  There are several common uses for this type of form.  They are often used as a feedback mechanism, whereby a visitor can send comments or suggestions about the site back to the webmaster.  They are also used as a mechanism to capture data and send it off to a recipient at a remote location, bypassing the need for a database in or near the system where the site is being hosted.  Webmasters come up with plenty of creative ways of using these forms, but increasingly over recent months, are also coming up against some problems.
The distinguishing characteristic of an email form is found in its "ACTION" statement in the <FORM> tag.  There is a description of this type of form in the HTML Goodies Tutorials at http://www.htmlgoodies.com/tutors/forms.html  In the example on that page we see this "ACTION" statement: <FORM METHOD="POST" ACTION="mailto:your email address">  The "ACTION" in this example is a "mailto:" with an email address.  It is this which defines this form as an email form.
The problem arises because modern browsers, IE6 + and equivalent, no longer support email forms!  The effect of this is that the visitor fills out the form and clicks the submit button and their email client program is invoked showing a blank email with the specified address in the "To" field.  All information entered on the form appears to have been ignored.  Essentially, these browsers are treating the email form as if it was a simple "Mailto" email link (for information about email links, see http://www.htmlgoodies.com/primers/primer_4.html )
That's the problem, but like all good programmers all we see is an opportunity for a creative solution!  With that in mind, here are a couple of offerings.  The first is a solution primarily aimed at Unix (or similar) operating systems, and involves the use of CGI (Common Gateway Interface - see http://www.htmlgoodies.com/beyond/cgi.html ) and a mail system such as SENDMAIL (commonly installed on Unix and Linux systems.)  The second is a little more specialized, in that it requires FrontPage Extensions.
The first involves the use of a script to send the email form.  One such script is the very popular formmail.pl available from Matt's Script Archive at http://www.scriptarchive.com/formmail.html  This script is accessed via the "ACTION" as in this example:
<FORM ACTION="/cgi-bin/formmail.pl" METHOD="POST">
There is a lot of comprehensive help information on Matt's site that describes very well how to use this script, so there is not much point in going into details here.  There are a couple of things to point out, however.  First, in order to use this script, the host system must support CGI and make it available to you.  Check with your hosting company if you're not sure.  Secondly, you would be well advised to heed the security advice that Matt offers.  Formmail, being a popular script, is the target of a lot of exploitation.  Some good sense precautions can go a long way to minimize the exposure.  It is worth noting that most of the exploits become a problem for your hosting company more than for the website itself.
The second solution is available where FrontPage Extensions are available on the hosting server.  The extensions will also need to have been configured to handle email.  Again, check with your hosting company if you're not sure. Included in the FrontPage Extensions is a series of capabilities provided by what Microsoft calls "Webbots".  If you use a FrontPage Extension aware editor to create your form, the program will provide you the ability to specify an email address to send the form data to as a property of the form.  The program then generates the instructions needed to utilize the Webbot to send out your email.  This is a very simple method, but does depend on the availability of the extensions and a suitable editing program (such as FrontPage itself.)
In addition to these two types of solution, there are numerous other options of varying degrees of complexity.  There is not enough room in here to go into details of these here, but instead it is my hope that these two relatively simple options will provide you a quick and simple solution to the pro
Thanks for reading!
- Vince Barnes
Q & A Goodies
Questions are taken from submissions to our Community
Mentors. You can ask a Mentor a question by going to
Q. Is possible to click on the TEXT link and have it change to a new color and remain in that color without it going back to it's original color?
A. You could set up a couple of classes this:
   A.linkcolora {color:red}
   A.linkcolorb {color:blue}
And then in your link you could assign one of the classes for the initial color and use the onClick to change the color.  Here is an example:
<A HREF="page1.html" class="linkcolora" onClick="this.className='linkcolorb'" TARGET="framec">Click</A>
The above example assumes that you are using the TARGET property to target which frame to load the document in.  When you click on the link the onClick event will change the class name to linkcolorb which is blue.  Now if you want to change the color of that link back when another link is clicked on then it gets a little more complicated.
Here is an example of using JavaScript to change the Class Name of the link clicked to the one for a different color.  It also makes sure that the other links Class Names are switched back to the original if not.  The way the script works is when you click on the link the onClick event will perform the
function chgcolor().  This function has the links properties passed to it and then the Class Name is changed so that the color changes.  The second part of the function places all of the links on the document into an array and then a for loop checks to see if the link is not equal to the id of the link clicked.  If it is not then the class name is changed to the original class name.  There are probably other ways to do this, but this is what I came up with quickly. 
This example doesn't use frames, but you should be able to adapt it.
<title>Link Color Change</title>
    function chgcolor(lnkobj)
       if(document.getElementById) // check for IE5+ and NS6+
          // This line will change the Class Name of the link clicked
          // This line will place all of the links in the document
          // in to an array called links.
          total=links.length // get the number of links
               // if the id of the link in the array is not equal to the
               // the link clicked the change the class name to linkclassa.
<a href="#" id="linka" class="linkclassa" onClick="chgcolor(this)">Click Me</A>
<a href="#" id="linkb" class="linkclassa" onClick="chgcolor(this)">Click Me</A>
<a href="#" id="linkc" class="linkclassa" onClick="chgcolor(this)">Click Me</A>
Q. I just finished the 1st tutorial. It says that the Word files should be saved as text and named with an .htm suffix. So, I opened a Word file, chose Save As, and chose .txt as the Save As type. I also renamed the file to include an .htm extension. Then when I clicked Save, I got a File Conversion dialog box warning me that "Saving as a text file will cause all formatting, pictures, and objects in your file to be lost." It gives me Text encoding choices, Options, and End lines with options. What should I choose? I don't understand what all the choices mean. And it wasn't kidding - I lost all of the formatting I had on the original Word document. But if I save it as .htm from the Save As type box, I don't lose my formatting.
A. When you make a file choose "Save As" and not just "Save". Then at the bottom where it says save as type choose "web Page" (.htm .html) and it will give the file a htm extension. You can also just type .html for the extension if you want to use that one.
[Recent versions of Word support HTML directly, even providing WYSYWYG editing capabilities for web pages.  Earlier versions of Word supported HTML files only as text files, in much the same way as Wordpad does today. - Ed.]

Q. I am trying to open a new window using Javascript and I have suceeded in doing so. But I have encountered a problem: the window opens with half on the screen and half the window off. Basically if a user wants to see the other half of the new window, they must drag it into a new position. Do you have any sugestions on how to get the window to open on a specified place on the x-axis and the y-axis of the  user monitor?
A. One method is to use the top and left properties.  Here is an example:
function OpenWin()
   { PopMen=window.open ("poplink.html","popwin",config="width=175,height=225,location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resizable=no,top=0,left=0");

Q. I want to build a site where people can download documents (.pdf) where do I start?
A. You want to build a site where people can download PDF documents...is a little broad. Do you want to know how to build the site? Do you want to know how to offer the files for download? Do you know HTML? Are you familiar with building websites at all? We can certainly help you with these different aspects but we can't take you step by step through this email. We are only here to help with the areas in which you get stuck. If you are just starting out then the first place to start is here: http://htmlgoodies.earthweb.com/primers/primer_1.html
To allow people to download PFD files or any other file, just create a link to that file. If the person has the program to read the document it is possible that it will open right from the web. To avoid this you can either place the file in a ZIP file or tell the user to right click and choose "Save target as..."
Q. I want to move the mouse over some text and have a small box of text appear, similar to a pop-up button menu.  I don't want it to be a menu.  I just want it to give a quick explanation of the text.
A. If you wrap the text with the <A HREF> tag you could use the TITLE property which is supported by NS6+ and IE5+ browsers.  An example would be this:
<A HREF="#" TITLE="Apples are good to eat.">Apples</A>
If the above does not work out there are several "Tool Tip" scripts that also would work. The nice thing about the above example is that it does not require Javascript.

Q. I was using the tutorial in my HTML goodies book on JavaScript.  I used the code in the book, but i altered it for my own use.  I cant get it to work, and I dont know why.  It seems like a perfectly sound code to me, but when I try and run it, i get an Object Expected error for the <onLoad> command. (code was attached)
A. In your script, you have "funtion dateinbar()", just change it to "function dateinbar()" and the problem should go away.
[This is such a common type of error - no matter what your level of experience, have someone else look at your code.  Often a fresh pair of eyes sees something so obvious that we ourselves keep missing it!]
Discussion Goodies
Have you seen the discussion forums on the HTML Goodies website?  It's a great place to get help from others who, just like you, are developing web pages.  Many different topics appear in the forum, and a new one will appear if you create it!  Here's a sample of recent topics:
The requested method POST is not allowed?:
News Goodies
FTC: CAN-SPAM Is Working
[December 20, 2005] With a big helping hand from technology, feds spam say volume is declining. But are spammers staying away?
Read the article:

Former Qwest CEO Nacchio Indicted
[December 20, 2005] Other former employees join him in legal spotlight.
Read the article:

What's The AOL/Google Deal?
[December 20, 2005] Analysis: Is it a match made in heaven or a slippery slope for both parties?
Read the article:

IDC: PC Outlook Strong -- For Now
[December 20, 2005] There's a strong demand for portables, but overall growth is expected to slow in 2006.   
Read the article:

IBM Adds More to Rational Portfolio
[December 20, 2005] Big Blue works to get the project and portfolio management software integrated to rest of its Rational line.
Read the article:

Telecommuting Eases NYC Transit Strike Pain
[December 20, 2005] UPDATED: Some of the city's workers are taking advantage of the halt in the city's subways and buses.
Read the article:

Multi-Core? It's No Panacea
[December 20, 2005] Ex-Intel chip architect says competition from AMD is good for the industry and Intel.
Read the article:

Oracle Tops Off ID Management Suite
[December 20, 2005] With its past year's acquisitions fully integrated, Oracle proudly releases its latest security software.
Read the article:

Oracle Favors Sun in Licensing Change
[December 19, 2005] Oracle again cuts its per-processor licensing model to make its software more attractive.
Read the article:

DTV Transition Date Set
[December 19, 2005] House approves the transition date; Senate expected to agree today.
Read the article:

Feedback Goodies
Did you ever wish your newsletter was an easy two way communications medium?  Ploof! It now is!
If you would like to comment on the newsletter or expand/improve on something you have seen in here, you can now send your input to:
We already receive a lot of email every day.  This address helps us sort out those relating specifically to this newsletter from all the rest.  When you send email to this address it may wind up being included in this section of the newsletter, to be shared with your fellow readers.  Please don't send your questions to this address.  They should be sent to our mentors: see http://www.htmlgoodies.com/mentors/
Thanks for all your feedback!

Windows Tech Goodie of the Week 
Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 2
In this article we will examine ASP.NET 2.0's role service. We'll start by seeing how to setup and configure the roles service on a website, along with how to base authorization rules using roles. In addition, we'll look at how to programmatically work with the roles service, and see how to use the LoginView Web control to show information based on the logged in user's role. Read on to learn more!

*** AND ***

Reduce Web Form Spam by Checking Server Variables
Spam isn't just an e-mail problem anymore. Web forms are now a routine target of spammers. Whether your web site is a personal one just looking for feedback or a commercial site generating sales leads, getting dozens of entries for link exchanges or online gambling sites isn't anyone's idea of useful feedback.

*** AND ***

Networking Features in .NET Framework 2.0
The .NET Framework version 2.0 introduces a new namespace named System.Net.NetworkInformation that encapsulates all of the network related features. This namespace exposes a number of classes that provide useful information about the network. In this article, Thiru Thangarathinam examines the classes and features available in the System.Net.NetworkInformation namespace and provides examples that show how easy they are to utilize in your .NET applications.
And Remember This ...
1989 US Invaded Panama
Wanting to overthrow the dictator Manuel Noriega, who had been indicted in the US on drug charges, the US invaded Panama on this day in 1989. In the early 70's he had been recruited by the CIA to assist the US in its efforts against the spread of communism in Central America.  By the late 70's he became involved in drug trafficking and was dropped from the CIA payroll.  In 1979 the communist Sandinistas came to power, and in 1983 Noriega was brought back in to the CIA.  He became the military dictator of Panama.  In 1986 reports surfaced that he had been a double agent, working also for the Cuban intelligence agency and for the Sandinistas.  He was disowned by the US government and indicted by Federal Grand Juries on drug smuggling and money laundering charges.  President Bush had increased the US military security force in the canal zone when, on December 16 1989 a US Marine was shot dead at a Panamanian Defense Force roadblock.  The next day President Bush authorized "Operation Just Cause" and on December 20, 9,000 US troops joined the 12,000 already there.  By December 24, Noriega and his PDF were crushed.  The US made Guillermo Endara President of Panama (he had actually been elected, but the election was annulled by Noriega) and on January 3 1980 Noriega was arrested by US Drug Enforcement Agency agents.  The Organization of American States and the European Parliament both called the invasion a flagrant violation of international law.

Today was also the day that in: 1620 the Mayflower, with 103 pilgrims aboard, landed at Plymouth Rock; 1835 HMS Beagle, with Charles Darwin aboard, sailed into the Bay of Islands, New Zealand; 1898 Pierre and Marie Curie discovered Radium; 1914 the first feature length (silent) film comedy, "Tillie's Punctured Romance" was released, starring Marie Dressler, Mabel Normand and Charles Chaplin; 1923 Nepal became an independent nation (formerly a British Protectorate); 1933 Five year old Shirley Temple was signed to a studio contract with 20th Century Fox; 1937 the first feature length, color and sound cartoon, "Snow White" (Disney) premiered; 1946 1,086 died in an earthquake in southern Japan; 1948 the State of Eire (formerly the Irish Free State) declared its independence; 1954 Dr. Sam Sheppard was convicted of the murder of his wife, Marilyn (inspired "The Fugitive"); 1968 David Crosby, Stephen Stills & Graham Nash premiered together in California; 1978 Police in Des Plaines IL, arrested John Wayne Gacy Jr for murder; 1979 Zimbabwe adopted its constitution; 1988 New York bound Pan Am jumbo jet (Flight 103) exploded over Scotland, killing all 259 people on the plane and 11 people on the ground; 1989 Vice-President Quayle sent out 30,000 Christmas cards with word beacon spelled 'beakon'; 1991 actress Jane Fonda married CNN-director Ted Turner (her birthday); 1994 Bomb exploded on #4 train on Fulton Street NYC;

Born today were: in 1117 Archbishop of Canterbury Thomas Becket; 1804 British Prime Minister Benjamin Disraeli; 1850 Hadassah founder Henrietta Szold; 1879 Russian dictator Joseph Stalin Dzoegashvili; 1918 Nazi/ 4th UN Secretary General/Austrian President Kurt Waldheim; 1937 actress Jane Fonda; 1940 musician Frank Zappa; 1943 musician Albert Lee; 1944 actor Jared Martin; 1948 actress Carol Potter; 1957 comedian/actor Ray Romano; 1965 actor Andy Dick; 1978 actor Michael Vitar;

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date