Wednesday, April 23, 2008

Automatically Running a Script From Within a Web Page

It's very simple to run a script (for example, a CGI script) by clicking a button in a form:

(Note that in the code snippets in this article, square brackets are used instead of angle brackets.)

[form name="form1" method="post" action="/cgi-bin/updatePage.cgi"]

:

:

[/form]

Sometimes,
however, you might need to run a script automatically from within an
HTML page, without requiring the user to perform an action. You might
want to do this if, for example, you have one or more variables that
have been generated perhaps by another script, which you need to
process without user interaction.

If you insert the following
code into an HTML page, the script (in our case, updatePage.cgi) will
be automatically executed when the web page is loaded into a browser.

[img src="/cgi-bin/updatePage.cgi" height="1" width="1"]

In order to ensure that a broken link is not generated by the cgi script itself, include the following code in the script.

print "Content-type: image/gif";

open IN, 'image.gif' or die "Cannot open: $!";

binmode IN;

print while ;

close IN;

There also needs to be an image called image.gif in the same directory (cgi-bin) as the cgi script.

I
often use this technique automatically perform certain text processing
activities in my content management systems. For example, I might have
one or more ASCII files that need to be automatically updated at the
end of an operation, but I don't want to force the user to click, for
example, an update button.

About the Author: John Dixon is a web developer working for My Health Questions Matter,
a company that helps users of the health service to ask the right
questions when discussing their medical condition with health
professionals. John is also interested in computer history, and
maintains http://www.computernostalgia.net,
a site dedicated to the history of the computer. John also provides web
development services to large and small clients via his own company John Dixon Technology Limited.

Flash SEO Techniques

Currently, most flash content cannot be seen by
search engines (and when it is seen, is seen to only a limited extent).
This is because the search engine robots see a file within the overall
page source code and cannot see the structure of the navigation within
it. It may be able to dig some text content out of it, but for the most
part, even the text content is read as just graphics, and cannot be
indexed.

The best way to create a search engine friendly version
of
your flash content (and to still show the content) is to use SiFR,
or Scalable Inman Flash Replacement. This is preferred to standard
noscript tags and redirects, plus the usage of this has been approved
by Google on their blog.

How SiFR works with Flash -

First
of all, lets assume you've embedded flash within the overall page, as
opposed to just making one big flash page first of all. Otherwise you
may have to revisit the step of integrating flash into html first.
Otherwise when a standard html page that happens to contain flash is
reached, a JavaScript function is run which first checks that Flash is
there, looking for whatever tags you have designated for it.

If
the user does not have flash installed, or if JavaScript is turned off
(the latter being the case with search engine spiders) the HTML page
displays as normal (without the flash content) and nothing further
occurs. If Flash is installed, and JavaScript turned off however, the
browser views the source code of your page looking for SiFR elements.
After this, the script creates Flash movies of the same dimensions and
displays them on top of the original location. This can be tested in
Mozilla Firefox via the use of an addon.

Visit Evolution Search Marketing for more tips on Flash SEO and other optimization methods.

Flash
can be a great addition to a website, and can work with a well
optimized website if done right and not overused. Find out how evolution search marketing can maximize the visibility of your flash content by dropping us a line.

Shameless Flashers - Using Flash Tools To Create Spectacular Websites

Flash is a powerful technology that can help you
create spectacular websites, tutorials and demos. Find out which
inexpensive tools are available to you that have very low learning
curve.

SWFText

SWF Text is an author tool of Flash text
animation. It embraces 150+ text effects and 20+ background effects,
and users may also customize all the properties of a Flash, including
font, text color, and layout, etc. With SW FText, a user without any
experience of Flash development can easily create a Flash banner or an
introductory page within a few minutes. And all you need do is to input
text, select font and animation effects. While a veteran Flash designer
may use SWF Text for text animation in a project, which sure greatly
saves your time and effort.

Sothink SWF Decompiler

Sothink
SWF Decompiler is a tool to browse, view and parse Shockwave Flash
movies (.swf files). It can extract sounds, images, movie clips from a
Flash movies. What's more, SWF Decompiler can decompile the action
scripts in a Flash movie and turn them into neat and readable code.
Sothink SWF Decompiler can convert your SWF to FLA. It supports
exporting the whole movie file in FLA format, compatible with Flash 6
and Flash 7. Sothink SWF Decompiler supports Action Script 2.0 fully.
It supports exporting ActionScript 2.0 while converting swf to fla and
supports exporting the .as file and Flash Project file (flp) while the
swf file contains AS 2.0 class. Within the program, it can decompile
the code written in Action Script 2.0 and display the readable code in
Action Script window, with syntax highlighting.

ScreenFlash Professional

If
you want to build animated, interactive software tutorials in the
shortest time, ScreenFlash is your best choice. It is the easiest and
most effective tool for demonstrating your software product, adding
animations to your application's Help system, or training novices.
ScreenFlash captures the action and sound from any part of Windows
desktop and saves it to a Macromedia Flash movie file. You can also
edit the movie by adding button, sound, picture and text, which can
create an integrated interactive demo.

More Flash Resources:

SWFText

http://www.deprice.com/swftext.htm

Sothink SWF Decompiler

http://www.deprice.com/sothinkswfdecompiler.htm

ScreenFlash Professional

http://www.deprice.com/screenflashprof.htm

John Deprice owns and operates http://www.deprice.com