[newbie] shtml question

L

Larry

Hi folks!

Maybe this has been covered before but I didn'd find anything helpful on
google.
I've a .shtml?k=1000 kind of page,here's the code:

--
<html>
<!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
</html>
--

Now, I'd like to pass the "k" value to "page.cgi" (before .shtml page
being parsed by the server)

Can It actually be done? (If not,I'll be in a mess!!!)
 
P

Paul Lalli

Larry said:
Hi folks!

Maybe this has been covered before but I didn'd find anything helpful on
google.
I've a .shtml?k=1000 kind of page,here's the code:
--
<html>
<!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
</html>
--

Now, I'd like to pass the "k" value to "page.cgi" (before .shtml page
being parsed by the server)

Can It actually be done? (If not,I'll be in a mess!!!)

Your question is not about Perl. Your question is about Server Side
Includes and Web Servers. You can determine if this question is about
Perl by asking yourself "Would anything about this question change if my
cgi program were written in C instead of Perl?". The answer here is No.
Learning how to partition your problem is an important first step in
solving your problem.

Paul Lalli

P.S. Despite myself, your question made me curious. Browsing for about
20 seconds at Apache's documentation returned this page, that will
probably help you: http://httpd.apache.org/docs/mod/mod_include.html
 
G

Gregory Toomey

Larry said:
Hi folks!

Maybe this has been covered before but I didn'd find anything helpful on
google.
I've a .shtml?k=1000 kind of page,here's the code:

--
<html>
<!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
</html>
--

Now, I'd like to pass the "k" value to "page.cgi" (before .shtml page
being parsed by the server)

Can It actually be done? (If not,I'll be in a mess!!!)

Mixing server side includes & cgi can be fraught with danger. Try html
templates instead.
http://search.cpan.org/~samtregar/HTML-Template-2.7/Template.pm

You might be able to pass a variable by ...page.cgi?k=1000 but I dont have a
clue how this interacts with ssi.

gtoomey
 
P

Paul Lalli

Larry said:
But I badly need to sort this problem out!!!

so forget about TEMPLATE...i need to pass a query string to my cgi script
...

Apparently you don't need to sort it out badly enough to read the
documentation I sent in my previous post.

Paul Lalli
 
B

Ben Morrow

Quoth Larry said:
Well, I know what you're talking about.

But I badly need to sort this problem out!!!

so forget about TEMPLATE...i need to pass a query string to my cgi script
...

Idiot.

*plonk*
 
K

krakle

Larry said:
Hi folks!

Maybe this has been covered before but I didn'd find anything helpful on
google.

Google is only as good as you use it...
I've a .shtml?k=1000 kind of page,here's the code:

Oh that kind of page......
--
<html>
<!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
</html>
--

Looks like HTML using SSI... So where's the Perl?
Now, I'd like to pass the "k" value to "page.cgi" (before .shtml page
being parsed by the server)
Can It actually be done? (If not,I'll be in a mess!!!)

Did you try it?
 
K

krakle

Paul Lalli said:
Apparently you don't need to sort it out badly enough to read the
documentation I sent in my previous post.

Paul Lalli

What he needs to do is try it.. If it doesn't work then you can't do
it. His other options are messing with Apache... BUT he SHOULD ask
himself why needs to use SSI in the first place...
 
G

Gunnar Hjalmarsson

krakle said:
he SHOULD ask himself why needs to use SSI in the first place...

Can it possibly be because he has a Perl program that he wants to
invoke from a static HTML page?
 
D

David Efflandt

Hi folks!

Maybe this has been covered before but I didn'd find anything helpful on
google.
I've a .shtml?k=1000 kind of page,here's the code:

--
<html>
<!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
</html>
--

Wrong newsgroup (not Perl specific), but there should NOT be a space in
<!--#exec (but a space before the trailing --> is proper). Read apache
docs about server side includes. That will also tell you that #exec
cgi= inherits the query string of the SSI page.
Now, I'd like to pass the "k" value to "page.cgi" (before .shtml page
being parsed by the server)

Can It actually be done? (If not,I'll be in a mess!!!)

You just need to get the QUERY_STRING from the environment and properly
decode it, or use the Perl CGI module (perldoc CGI).
 
G

Gregory Toomey

Larry said:
Mr. Ben Morrow , the idiot one is you.

Hardly, he's well respected in the Perl community, and you are unlikely to
get meaningful replies to your questions in the future.

gtoomey
 
K

krakle

Gunnar Hjalmarsson said:
Can it possibly be because he has a Perl program that he wants to
invoke from a static HTML page?

His code is:

<html>
<!-- #exec cgi="www.yousite.com/cgi-bin/page.cgi" -->
</html>


If that's the ONLY thing on the HTML page why not call the CGI script
directly. Seems pointless otherwise. So again, he SHOULD ask himself
why he needs to use SSI in the first place.
 
K

krakle

Gregory Toomey said:
Hardly, he's well respected in the Perl community, and you are unlikely to
get meaningful replies to your questions in the future.

gtoomey

Because he returned the insult he has done wrong? That's, idiotic to
think Gregory Toomey. And Ben Morrow is an idiot for saying what he
did. :)
 
B

Ben Morrow

Quoth Gunnar Hjalmarsson said:
Would you mind explaining how rejecting that idea makes the OP an
idiot?

Being rude to someone trying to help is what makes him an idiot, as does
stating (again) on Usenet how urgent the problem is (as though we care),
using multiple exclamation marks, mis-capitalising Perl module names
(Uri of couse gets an honourable exception to this :), and saying 'I
need to pass a query string' when Gregory has just suggested how this
might be done and any further problems he has with this are undoubtedly
with SSI not Perl.

Ben
 
G

Gunnar Hjalmarsson

Ben said:
Being rude to someone trying to help is what makes him an idiot, as
does stating (again) on Usenet how urgent the problem is (as though
we care), using multiple exclamation marks, mis-capitalising Perl
module names (Uri of couse gets an honourable exception to this :),
and saying 'I need to pass a query string' when Gregory has just
suggested how this might be done and any further problems he has
with this are undoubtedly with SSI not Perl.

Thanks for replying. I for one had hoped for an apology to the OP.

I agree on some (not all) of what you say, but nothing of it justifies
that kind of name calling IMO.
 
L

Larry

You just need to get the QUERY_STRING from the environment and properly
decode it, or use the Perl CGI module (perldoc CGI).

Just for the record:

<!--#include virtual="cgi-bin/script.cgi?${QUERY_STRING}" -->

thanks all the same
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,951
Messages
2,570,113
Members
46,700
Latest member
jody1922

Latest Threads

Top