Passing a value from a pure HTML script?

A

araminska

I always work from the perl end of a web page and very seldom see the
HTML code that the server puts out, so I am not an HTML heavy. But I have
a project that would be very easy if I could pass a single value from a
link in a static HTML script without using form action. Otherwise I have
to recode a huge static web page with links calling multiple subpages that
are almost alike except for a paragraph or two. (At this point I could
give a lecture about the mess that can occur when a "very bright" nephew
was hired for a project by the boss).

An example link is <a href="subpage.pl">Info</a> and obviously calls a
perl script with no options. I would like to call that same script from a
list of links but with some different value that the script would be able
to use to bring up the proper info.

Since all my looking in HTML books and googling always comes up with using
form action or javascript to pass values, it maybe that static HTML can't
do it.

If so, I can code the program the usual way, but I thought it would be
interesting to see if the above can be done.

Thanks any
Araminska
 
A

Adrienne Boswell

An example link is <a href="subpage.pl">Info</a> and obviously calls a
perl script with no options. I would like to call that same script
from a list of links but with some different value that the script
would be able to use to bring up the proper info.

<a href="subpage.pl?q=value">Info</a> then have your script look at the
querystring.
 
A

araminska

<a href="subpage.pl?q=value">Info</a> then have your script look at the
querystring.

Thanks much. Worked great. Althought, interestingly enough, now that I
know how to do it, I STILL can't find the answer in either of my HTML
books. That method appears to be so common that everybody knows about it
and mentioning it in a manual is not needed, or it is never used and nobody
cares.

Maybe I should get in on a project where I can work for a while on HTML
from the top down, rather than the bottom up:)

Thanks again
Araminska
 
J

Jonathan N. Little

araminska said:
Thanks much. Worked great. Althought, interestingly enough, now that I
know how to do it, I STILL can't find the answer in either of my HTML
books. That method appears to be so common that everybody knows about it
and mentioning it in a manual is not needed, or it is never used and nobody
cares.

Well is not strictly HTML, more a matter of scripting. You will find in
books about JavaScript and server-side PHP, Perl...

Google "query string" for more info.

<a href="subpage.pl?q=value">Info</a>

works like a form via GET method

<form action=subpage.pl" method="get">
<div>
<input type="hidden" name="q" value="value">
<input type="submit" value="Info">
</div>
</form>
 
H

Harlan Messinger

araminska said:
Thanks much. Worked great. Althought, interestingly enough, now that I
know how to do it, I STILL can't find the answer in either of my HTML
books.

It isn't an HTML feature, it's a feature of the server-side process
(Perl or whatever).
 
D

David Dorward

araminska said:
Thanks much. Worked great. Althought, interestingly enough, now that I
know how to do it, I STILL can't find the answer in either of my HTML
books. That method appears to be so common that everybody knows about it
and mentioning it in a manual is not needed, or it is never used and
nobody cares.

As far as HTML is concerned, a URL is a URL. It doesn't matter if it has a
query string or not.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Sun, 13 Jan 2008 10:44:41
GMT David Dorward scribed:
As far as HTML is concerned, a URL is a URL. It doesn't matter if it
has a query string or not.

And you are "The Duke of Url"...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top