How do I pass a value to a PERL script from an <a href?

R

Rodney

I want to use a regular HTML href to call a PERL script and I also want to
include information to pass to the PERL script.

IE:
<a href="/cgi-local/PerlScript.pl">

I would like to pass a value such as 567 along with this call.

Can it be done using a regular <A HREF= > ?
If so, what is the syntax?
 
A

A. Sinan Unur

I want to use a regular HTML href to call a PERL script and I also
want to include information to pass to the PERL script.

IE:
<a href="/cgi-local/PerlScript.pl">

I would like to pass a value such as 567 along with this call.

Can it be done using a regular <A HREF= > ?
If so, what is the syntax?

Rodney,

At this point, you would do yourself and everyone else a favor by taking a
deep breath and reading the posting guidelines for this newsgroup. They are
regularly posted here (also available on the WWW at
http://mail.augustmail.com/~tadmc/clpmisc.shtml).

CGI specific questions are is off-topic here. You might want to ask CGI-
specific questions, you may want to go to
comp.infosystems.www.authoring.cgi.

As for this specific questions, find out information about GET requests.

Sinan.
 
G

Gregory Toomey

It was a dark and stormy night, and Rodney managed to scribble:
I want to use a regular HTML href to call a PERL script and I also want
to include information to pass to the PERL script.

IE:
<a href="/cgi-local/PerlScript.pl">

Just like normal html:
<a href="/cgi-local/PerlScript.pl?var1=value1&var2=value2">

You can also generate an image (gif/jpeg/png etc):
<img src="/cgi-local/PerlScript.pl?var1=value1&var2=value2">

gtoomey
 
J

James Willmore

Rodney said:
I want to use a regular HTML href to call a PERL script and I also want to
include information to pass to the PERL script.

IE:
<a href="/cgi-local/PerlScript.pl">

I would like to pass a value such as 567 along with this call.

Can it be done using a regular <A HREF= > ?
If so, what is the syntax?

From a Perl script or raw HTML?
Post your code -or- post your question to a CGI authoring newsgroup.

Jim
 
B

Barry Kimelman

[This followup was posted to comp.lang.perl.misc]

I want to use a regular HTML href to call a PERL script and I also want to
include information to pass to the PERL script.

IE:
<a href="/cgi-local/PerlScript.pl">

I would like to pass a value such as 567 along with this call.

Can it be done using a regular <A HREF= > ?
If so, what is the syntax?

First of all this is not the appropriate newsgroup for CGI questiuons.
You shpould post this question to comp.infosystems.www.authoring.cgi.

Now with that having been said to pass a parameter value to a Perl
script you can do the following :

<a href="/cgi-local/PerlScript.pl?parm1=567&parm2=999">
 
B

Big and Blue

Barry said:
Now with that having been said to pass a parameter value to a Perl
script you can do the following :

<a href="/cgi-local/PerlScript.pl?parm1=567&parm2=999">

Well, not exactly (although we are still on HTML-authoring rather
than Perl here).

'&' is an active character in HTML, so you should actually use:

<a href="/cgi-local/PerlScript.pl?parm1=567&amp;parm2=999">

when putting this into HTML text. The fact that not doing so usually
works is only because browsers seems to assume you mean a raw & if they
don't find the matching ';' within a few chars.

Now (back more towards Perl here) if you are using the CGI.pm module
to handle this on the server side it allows you to use ';' as the
parameter delimiter so that you don't need to html_escape it (but you
should take care that you do html_escape the separate parts of the URI
if necesaary).
 
E

Eric Bohlman

First of all this is not the appropriate newsgroup for CGI questiuons.
You shpould post this question to comp.infosystems.www.authoring.cgi.

Agree with the latter statement, but the former needs some qualification.
c.l.p.m is not the appropriate newsgroup for CGI questions *whose answers
would be the same regardless of what language the CGI program was written
in* (as this question was), but it is appropriate for the Perl-specific
aspects of some CGI questions (such as, e.g. the specifics of using
CGI.pm).
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top