Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - Variables in HTML

 
Thread Tools Search this Thread
Old 01-07-2004, 10:14 PM   #1
Default Variables in HTML


Forgive me if this sounds trivial, but I hack a lot, but I think
I would best be described as a "hack of all languages". What
that means is I know just enough to be dangerous in the
computer languages I mess with.

Anyway........... I have a little applet I found online somewhere
and it has to do with displaying images. Now, the path to the
selected images is lengthy, so I've been looking around in what
I have for info on variable use and surprising to me I can't get
any useful info where I've looked. So, I thought I'd come here

What I want is a way to something like the following Tcl code:

set myPath "to/he/ong/path/to/my/photos"
set image01 "$myPath/image01.jpg"

and to follow with a lengthy list of imageXX.jpg's instead of having
to put in the long path in each line.

Not a major deal, but if it can be done, email me at my address
'cause I don't monitor newsgroups all the time.

Thanks for all help ........... ALF




Allen Flick
  Reply With Quote
Old 01-07-2004, 11:08 PM   #2
Mark Parnell
 
Posts: n/a
Default Re: Variables in HTML

On Wed, 07 Jan 2004 22:14:56 GMT, Allen Flick declared in alt.html:
>
> What I want is a way to something like the following Tcl code:
>
> set myPath "to/he/ong/path/to/my/photos"
> set image01 "$myPath/image01.jpg"
>
> and to follow with a lengthy list of imageXX.jpg's instead of having
> to put in the long path in each line.


HTML is a markup language, not a programming language. It cannot do any
calculations, does not have variables, etc.

You would need some sort of server-side language (the above looks
similar to PHP), or possibly a pre-processor.

>
> Not a major deal, but if it can be done, email me at my address
> 'cause I don't monitor newsgroups all the time.


Sorry, ask here, get answers here.

Why you shouldn't ask for E-mail responses on Usenet:
http://www.cs.tut.fi/%7Ejkorpela/usenet/mail-responses

--
Mark Parnell
http://www.clarkecomputers.com.au
  Reply With Quote
Old 01-07-2004, 11:56 PM   #3
 
Posts: n/a
Default Re: Variables in HTML


"Allen Flick" <> wrote in message
news:...
> Forgive me if this sounds trivial, but I hack a lot, but I think
> I would best be described as a "hack of all languages". What
> that means is I know just enough to be dangerous in the
> computer languages I mess with.
>
> Anyway........... I have a little applet I found online somewhere
> and it has to do with displaying images. Now, the path to the
> selected images is lengthy, so I've been looking around in what
> I have for info on variable use and surprising to me I can't get
> any useful info where I've looked. So, I thought I'd come here
>
> What I want is a way to something like the following Tcl code:
>
> set myPath "to/he/ong/path/to/my/photos"
> set image01 "$myPath/image01.jpg"
>
> and to follow with a lengthy list of imageXX.jpg's instead of having
> to put in the long path in each line.
>
> Not a major deal, but if it can be done, email me at my address
> 'cause I don't monitor newsgroups all the time.
>
> Thanks for all help ........... ALF
>
>


You would be better off incorporating PHP or ASP or something serverside.
But, if you are hell-bent on using HTML only, you could use server side
includes (SSI).
I dont think you save much code though...

<html>
<body>
<h1>SSI Test</h1>
<!--#set var="dir" value="/~myhomedir/stuff/images/" -->
<img src='<!--#echo var="dir" -->stuff.jpg'>
</body>
</html>





  Reply With Quote
Old 01-08-2004, 12:05 AM   #4
Leif K-Brooks
 
Posts: n/a
Default Re: Variables in HTML

Mark Parnell wrote:
> Why you shouldn't ask for E-mail responses on Usenet:


Might carry a little more weight if you weren't setting a reply-to
header to your email address.

  Reply With Quote
Old 01-08-2004, 12:28 AM   #5
Mark Parnell
 
Posts: n/a
Default Re: Variables in HTML

On Thu, 08 Jan 2004 00:05:53 GMT, Leif K-Brooks declared in alt.html:

> Mark Parnell wrote:
>> Why you shouldn't ask for E-mail responses on Usenet:

>
> Might carry a little more weight if you weren't setting a reply-to
> header to your email address.


I hadn't particularly realised I was. Thanks. Better?

--
Mark Parnell
http://www.clarkecomputers.com.au
  Reply With Quote
Old 01-08-2004, 01:41 AM   #6
Cameron
 
Posts: n/a
Default Re: Variables in HTML

xyzzy wrote:

<snip>
> You would be better off incorporating PHP or ASP or something serverside.
> But, if you are hell-bent on using HTML only, you could use server side
> includes (SSI).
> I dont think you save much code though...
>
> <html>
> <body>
> <h1>SSI Test</h1>
> <!--#set var="dir" value="/~myhomedir/stuff/images/" -->
> <img src='<!--#echo var="dir" -->stuff.jpg'>
> </body>
> </html>
>


I don't know much about SSI, but...since when were they part of HTML?

~Cameron

  Reply With Quote
Old 01-08-2004, 04:27 AM   #7
Owen Jacobson
 
Posts: n/a
Default Re: Variables in HTML

On Thu, 08 Jan 2004 00:05:53 +0000, Leif K-Brooks wrote:

> Mark Parnell wrote:
>> Why you shouldn't ask for E-mail responses on Usenet:

>
> Might carry a little more weight if you weren't setting a reply-to
> header to your email address.


Reply-To is not Followup-To, as I recall.

--
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution.

  Reply With Quote
Old 01-08-2004, 07:34 AM   #8
Toby A Inkster
 
Posts: n/a
Default Re: Variables in HTML

Allen Flick wrote:

> What I want is a way to something like the following Tcl code:
>
> set myPath "to/he/ong/path/to/my/photos"
> set image01 "$myPath/image01.jpg"
>
> and to follow with a lengthy list of imageXX.jpg's instead of having
> to put in the long path in each line.


I think the closest solution in HTML would be the BASE element:
http://www.w3.org/TR/html401/struct/...html#edef-BASE

But if you want to use variables properly, then use a proper programming
language (such as Perl, PHP, C++, TCL, whatever) to output your HTML.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump