HTML appropriate for my task?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I have just started a new job and need to develop a routine that
accesses the web. I am experienced with assy, c/c++, and tcl/tk, but
know almost nothing of HTML.

My task is to repeatedly download a file of known size repeatedly from
our company server to a mobile laptop (Windows XP) in order to check
connectivity as the vehicle is driver around an area. I would like to
be able to specify the retrieval interval, stop and start the routine,
and keep track of the success/failure of the attempt. Since I expect to
run into areas of poor reception I need to be able to set a short
timeout so a failure can be noted and then continue the cycle.

Do you think this sounds like an html/php type task or would it be
better done in a script?



Re: HTML appropriate for my task? says...
Quoted text here. Click to load it

What you are seakign of John, appears to be at a lower level than HTML.

It sounds to me like you need to brush up on a bit of basic HTTP, and
use a socket directly.

At that level, its basically; open a socket to the server and send it
text such as:

GET /file.txt HTTP/1.1\n

Then read the resulting socket stream.
The Proper Web server will add lots of HTTP headers an empty line then
the file contents. Any error will be in the HTTP result returned on the
first line of headers.


Re: HTML appropriate for my task?

HMS Surprise wrote:

Quoted text here. Click to load it

I'd write something in Perl. You could use an HTML interface, if you
wanted to.

Re: HTML appropriate for my task?

Quoted text here. Click to load it

A script that runs on the laptop. Of the languages you mention above,
Tcl would be more than suitable. You can use its http package to
retrieve the file.

Re: HTML appropriate for my task?

HMS Surprise wrote:

Quoted text here. Click to load it

HTML is about as appropriate for this as Word or PDF. You'll probably
use it, but it won't ever form the core of your application. It'll be
the end presentation format to the user at most.

If you did try to do this "in HTML" then you could produce one of those
still-popular abominations where HTML is used as a wrapper around
snippets of JavaScript. It might even work afterwards, but no-one will
ever understand your code.

You could well code this to "run on a web server". That's a pretty fair
way to do it, but you're coding _in_ some server-side language (perhaps
PHP, although it's not my favourite), rather than in HTML.

You might even do this in Tcl/Tk if that's what you already know.
Personally though I'd use Python.

Re: HTML appropriate for my task?

Andy Dingley wrote:
Quoted text here. Click to load it

Thanks all for posting. I lost my original post and in re-editing I
changed html/php to html. So I see how my post seems confused (
confusion seems to be my constant ally these days.).

What I was hoping for was that php ( which I must also learn) would be
a candidate for this app. However after giving it some thought I don't
believe a server side app would be appropriate because I am expecting
to lose contact from time to time. It would probably be best to run it
client side so I can control the process regardless of connection.

 I used tcl some years ago and I am glad to see that it has an http
package. Perhaps that would be my quickest solution as tk would allow
me to cob together a simple GUI.

BTW Andy, if PHP is not your favorite web development language may I
ask what is? Python? Always like to hear other's opinions, especially
since you are far more learned on this subject than me.

Thanks again,


Re: HTML appropriate for my task?

HMS Surprise wrote:

Quoted text here. Click to load it

I don't have just one -- I do "web development" on everything from huge
squillion dollar web applications (Java) through to 5-minute hacks that
only I will ever use (Python). I also generate much of my "content" via
XSLT.  Horses for courses.

Re: HTML appropriate for my task?

HMS Surprise wrote:
Quoted text here. Click to load it

If the laptop uses some form of Windows, I would create a .bat file
script that pings the server within a loop, exiting the loop and setting
an alarm if a ping fails after some delay.

If the laptop uses Linux or is a UNIX machine, a similar script can be


David E. Ross

Concerned about someone (e.g., Pres. Bush) snooping
into your E-mail?  Use PGP.
See my <

Site Timeline