Goodies to Go ™
October 11, 2004 — Newsletter # 306
This newsletter is part of the internet.com network.
http://www.internet.com
Featured this week:
* Goodies Thoughts – A Virtual Poster
* Q & A Goodies
* News Goodies
* Feedback Goodies
* And Remember This…
Goodies Announcement
The new Beyond HTML Goodies book
is now available!
Go beyond the basics
and learn how the pros add and use dynamic HTML features and advanced
JavaScript techniques. Beyond HTML Goodies demonstrates dozens of new and
different features readers can add to their existing Web pages using HTML and
JavaScript. The book starts with simple text and image tips, such as adding a
clock to a Web page or causing text to appear when the mouse moves over an
image. It gradually builds to more complex tricks, including manipulating forms
or working with cookies behind the scenes. Throughout the book, readers enjoy
Joe’s snappy style and “to the point” discussion of each “goody” in the book.
http://books.internet.com/books/0789727803
Goodies Thoughts – A Virtual Poster
I was asked to provide a solution to a friend of mine recently,
that I thought might be of interest to Goodies To Go readers, so here it is!
Basically, the requirement was to have a screen (in this case it was a
beautiful, big plasma screen, but the principle applies to any screen) that
would display a series of advertisements, rotating them at a predetermined
interval. It was also necessary that the advertisements be easily changed by the
client’s own staff, without requiring a lot of retraining.
"Does anybody on staff know how to make web pages?" I asked. "I can do the
basics," pipes up one of the staff. "Then I have solved the problem," I proudly
stated.
First I set up the computer that uses the plasma screen as its display, with the
following characteristics (btw – physical access to this computer was going to
be a little awkward so I set it to be remote managed, which can be done with
such things as VNC (http://www.realvnc.com),
PC Anywhere (http://www.symantec.com/index.htm),
Go To My PC (https://www.gotomypc.com)
or, as in this case, using Windows XP Pro, Remote Desktop):
– The computer’s BIOS was set to turn the machine on automatically after a power
outage.
– Windows was set to automatically log on "User1" (User1 was created as a user
of the computer for this purpose) (For windows automatic logon info, see
http://www.microsoft.com/windowsxp/using/setup/learnmore/tips/knox2.mspx)
– User1’s desktop was set to 1280×768 (the native resolution of the display)
– User1’s home page was set to a special site we built (details coming up) (to
set the home page in IE, go to Tools / Internet Options & type the address of
the desired Home Page in the box so named)
– IE was added to User1’s "Startup" group (by dragging and dropping, or copy &
paste)
– IE was opened & set to full screen mode (in IE go to View / Full Screen, or
simply press F11)
– The IE toolbar was set to Autohide (in full screen mode, right click on the
toolbar and check "Autohide")
At this point, IE was closed (to save its current settings) and the machine was
restarted (to test everything – which, by the way, worked like a charm!)
Now, to the website…..
First, I created a home page (index.html) to be the first advertisement page,
and included a Meta Refresh to pull the next advertisement (the "Meta refresh"
client pull technique was discussed in these two newsletters:
https://www.htmlgoodies.com/letters/269.html and
https://www.htmlgoodies.com/letters/270.html) My second page was called
page2.html (not really something that called for a lot of creativity!)
Page2.html refreshed onto page3.html and so on, until the last page in the
series refreshed back to index.html and completed the cycle.
The amount of time each advertisement is on display is controlled by the
parameter in the Meta Refresh in its page, and the number and order of
advertisements depends on the number of pages and their refresh order. Simple!
With the framework of the site thus built, and with a skeleton page from which
to work, anybody with basic HTML knowledge would be able to create the
advertisement pages (assuming that somebody gives them the text, pictures and
layout desired for each page!)
That’s it! A simple solution to an intriguing problem. I hope you find a useful
answer in here for something you’d like to do, too!
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
https://www.htmlgoodies.com/mentors.
Q. I have several pages on my web site that are totally independent, i.e.
there are no links to them. These pages contain information that I might want to
look at from another computer. But I don’t want others to be aware of them. Is
there any way for a casual visitor, or even a hacker, to learn the names of
these pages? The names are not obvious, and there’s no way a person could guess
at the names. I have a page called /index.html, which is the page a visitor gets
to by typing in the domain name.
A. If a page is on the internet, the serch engines will eventually find
it and index it into it’s database. Unless you take some measures to tell the
search engines not to index the page. Using the ROBOTS.TXT file you can tell
search engines which folders and file to index and not to index. It is a small
text file that sits in the root of your web directory. The following page will
explain in detail about the file.
http://www.seoconsultants.com/robots-text-file
Put all of the files that you do not want the search engines to index into one
folder and name that as a disallowed folder in the ROBOTS.TXT file. Another
option would be to password protect a folder and place all of the files in that
folder. Your web host probably offers a password protected folder and they set
it up for you.
[See also
http://htmlgoodies.earthweb.com/letters/210.html — and, btw, if there are
really NO links to the pages & there is an index page in the directory with
them, as you describe, there will be no way for the search engines or casual
visitors to find them (although somebody with physical access to a machine you
had been using to view them could find them in the browser’s history, unless you
cleared it). A hacker would have to hack their way into your system to find
them. – Ed]
Q. With internet access being provided by cable, dsl, or satellite, IP
addresses are pretty much constant now. So, if I wanted to host a web site
(domain name and all) using the personal web server (obviously I’m running
windows 98se), how would I deal with the dns thing?
A. Do you subscribe to the HTML Goodies Newsletter? I believe you can
find what you want in this issue:
https://www.htmlgoodies.com/letters/276.html
Q. I’m stuck on having a page containing a drop-down with options, but I
wanna click on my option and go to that place.
A. Here is an example that you can use,
<html>
<head>
<title>Drop Down</title>
<script language="JavaScript">
function LinkUp(selopt)
{
if(selopt!="") // if variable is not empty (they selected the first
option)
{
location.href=selopt
}
}
</script>
</head>
<body>
<form name="DropDown">
<select name="DDlinks"
onchange="LinkUp(this.options[this.selectedIndex].value)">
<option value="">Select One</option>
<option value="http://www.siteone.com">Site One</option>
<option value="http://www.sitetwo.com">Site Two</option>
<option value="http://www.sitethree.com">Site Three</option>
</select>
</form>
</body>
</html>
Q. When I have a user enter a number to be used for math it is treated as
a string. Then when I do math with it the number is added to the end which makes
the answer incorrect. Can you please give me a method for the user to be able to
enter a number and have it treated like a value instead of a string? Or if not,
is there a way to convert strings into values?
A. JavaScript interprets a default value given to a text area as a
string. The workaround is to use the eval() function when processing that value
as a number. If your user inputs a number to a text area in a form, and that
number is to be added, subtracted, mutiplied, … etc, process the number within
the eval() function. From your previous example, suppose the user inputs to the
variables a and b via text boxes in a form, you can then add a to b to return c
with this:
c = eval(a+b)
This way, the values in both a and b will be treated as numbers instead of
strings.
Q. I have one more problem with JavaScript programs. A lot of times I
create variables and then when I try to use them I get an error saying that they
are undefined. Why is this? Here is an example of when this happens:
<SCRIPT LANGUAGE="JavaScript">
function part1()
{
var a = 1;
}
function part2()
{
if (a == 1)
{
document.form.textbox.value = "The variable worked, finally!!!";
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="form">
<INPUT TYPE="RADIO" NAME="why_doesnt" VALUE="the_variable_work" onClick="part1();">
<INPUT TYPE="BUTTON" VALUE="Variable work?" onClick="part2();">
<INPUT TYPE="TEXT" NAME="textbox" VALUE="If the variable worked, a message would
appear here.">
</FORM>
If I write this in a document and click the button, an error message comes up
saying that it is undefined. I’ve tried creating the variable directly from the
event handler, renaming the variable, using checkboxes instead of radio buttons,
and nothing works. I have tried putting an alert box in the function and it
comes up so I know the function is executing. It just won’t remember the
variable.
A. You are declaring a as a variable from within a function. This makes
it a local variable that is only accessable by that function. You can make it a
global variable that is accessable by any function by declaring it from outside
any functions, but still between the script tags. Usually global variables are
declared before the first function for the sake of clarity, but they can be
declared from anywhere between the script tags, just not inside a function.
Here’s your script with a as a global variable:
<SCRIPT LANGUAGE="JavaScript">
var a = 0; // declares a as a global variable and initializes it to 0
function part1()
{
a = 1; // the function sets the global variable a to equal 1
}
function part2()
{
if (a == 1)
{
document.form.textbox.value = "The variable worked, finally!!!";
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="form">
<INPUT TYPE="RADIO" NAME="why_doesnt" VALUE="the_variable_work" onClick="part1();">
<INPUT TYPE="BUTTON" VALUE="Variable work?" onClick="part2();">
<INPUT TYPE="TEXT" NAME="textbox" VALUE="If the variable worked, a message would
appear here.">
</FORM>
Q. I had to make some last minute changes to my home page and transferred
it (FTP) None of the changes I made show up on the page. I removed the home page
from the domain and then sent the new one, and still the same problem. I just
can’t seem to figure it out.
A. Try emptying your browser cache and history and then reload the page.
Double check that you are uploading the page to the correct folder AND the
correct website if you have more than one website that you work on. I have made
the mistake of uploading to the wrong site. Let me know how you make out. 9
times out of 10 it is a caching problem.
News Goodies
Congress Gives Tax Break to Tech Industry
[October 11, 2004] Bush expected to sign bill reducing taxes
on foreign dividends for U.S. multi-nationals.
Click
here to read the article
Web Servers, BIND Top 2004 Vulnerabilities List
[October 11, 2004] The SANS institute breaks down the top 10
vulnerabilities in Windows and Unix systems.
Click here to read the article
Sprint Goes on the Offensive Against Attacks
[October 11, 2004] The carrier beefs up network to protect customers from
threats.
Click
here to read the article
MontaVista Kicks Off Real Time Linux Campaign
[October 11, 2004] The embedded distribution company wants to
address non-PC Linux devices.
Click here to read the article
StorageTek to Offer New Disk Systems, Software
[October 11, 2004] The storage systems concern is to unveil
systems and software that simplify and round out its
portfolio.
Click here to read the article
School of Secure Hard Knocks
[October 8, 2004] FEATURE: Colleges and universities are cramming for
security tests, as they face the tech challenges that come with vulnerable
systems and enterprising students.
Click here to read the article
Judge Denies AMD Access to Intel Documents
[October 8, 2004] A federal judge won’t force Intel to turn over internal
documents, the latest development in the legal battle.
Click here to read the article
MySQL Embracing Microsoft Open Source Project
[October 8, 2004] The open source database company reveals that it is
using Microsoft’s open source WiX project in part of its next release.
Click here to read the article
Entertainment Industry Looks For Supreme Relief
[October 8, 2004] The movie and music industry is taking its P2P case to the
highest court in the land.
Click here to read the article
FTC Pursues Former Spam King in Court
[October 8, 2004] The agency files for restraining order against Wallace to
halt his spyware activities.
Click here to read the article
Every week a site is selected for review. Each week,
reviews of the previous week’s selected site are chosen for
publication on the HTML Goodies website.
The current week’s selected site is published in Goodies To
Go and in the Peer Reviews section of the website.
Current contact email addresses for submitting your site and
for submitting reviews are published in Goodies To Go.
If you would like to have your site reviewed, sign up for
the Goodies To Go newsletter in the Navigation Bar on the
left side of this page.
For full details about this program, see
https://www.htmlgoodies.com/peerreviews
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:
mailto:nlfeedback@htmlgoodies.com
We already receive a lot of email every day. This address will help 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
https://www.htmlgoodies.com/mentors/
A few people have asked about the disappearance of the "Peer
Reviews" "coming soon" notice, so I thought I’d better
explain. We have quite a few improvements to the Goodies To
Go website in the works. These include a lot of changes that
will make the site easier for you to use, as well as some
that will make the site easier for us to maintain. The
changes to the Peer Reviews, which include several "ease of
use" solutions are involved in the overall project and I
didn’t want to keep saying "coming soon". I thought you’d
better appreciate not having to see that week after week. I
didn’t mean to scare you though! They will be back before
too long!
Also you’ll notice that the Windows Tech Goodies are missing
from this n/l, we’re just playing catch-up there too —
they’ll be back next week.
Thanks again for all your feedback!
Top
And Remember This . . .
On this day in…
1899 Boer War Began
On this day in 1899 war began between the British Empire and the
Boers, also known as Afrikaners, in the Transvaal and Orange Free
State in South Africa. During the Napoleonic wars, in 1806, Britain
took possession of the Dutch Cape colony of Afrikaners, who were the
descendants of the original Dutch settlers of the area. The Boers
objected to the Anglicization of South Africa and to Britain’s
anti-slavery policy, and began to move out into tribal territories,
where they created the Transvaal and the Orange Free State and for a
while, lived in peace with the British. In 1867 the discovery of
gold and diamonds in the area sparked conflicts. In 1899 full scale
war began. For some time the Boers, using Guerilla tactics,
frustrated British efforts. In 1901 the British began a search and
capture campaign, gathering the families of Boer soldiers into
concentration camps. By 1902 the Boer resistance was defeated and on
May 31, 1902, the Peace of Vereeniging was signed. In 1910, the
British created the autonomous Union of South Africa, which included
the province of the Transvaal, the Orange Free State, the Cape of
Good Hope, and Natal.
Today was also the day that in: 1737 300,000 were killed by
an earthquake in Calcutta, India; 1890 the Daughters of the
American Revolution was founded; 1923 the German Mark fell to
4 billion per US$ (the paper was more expensive than its face
value); 1945 the Chinese Civil War started (Chiang Kai-Shek v
Mao Tse-Tung); 1975 "Saturday Night Live" premiered with
guest host George Carlin; 1981 an unknown rocker known only
as Prince opened for the Rolling Stones at LA’s Coliseum; 1983
Last hand-cranked telephones US went out of service as 440
telephone customers in Bryant Pond, Maine, were switched over to
direct-dial; 1986 Reagan & Gorbachev opened talks at a summit
in Reykjavik, Iceland; 1987 200,000 gays marched for civil
rights in Washington DC; 1990 Center for Urban archaeology
opened in NYC at the South Street Seaport Museum; 1991 Anita
Hill testified that Clarence Thomas sexually harassed her;
Born today were: in 1821 YMCA founder Sir George Williams
(England); 1844 food company founder Henry John Heinz;
1884 US First Lady Eleanor Roosevelt; 1925 actress Nancy
Guild; 1946 actor Felton Perry; 1948 musician Daryl
Hall; 1950 actress Catlin Adams; 1953 actor David
Morse; 1962 comedienne Joan Cusak; 1962 Leslie Landon;
1971 actor Luke Perry; 1975 actress Kellie Martin;
Thanks for reading Goodies to Go!