httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marty Landman <MLand...@face2interface.com>
Subject Re: [users@httpd] CGI program loading a page
Date Sun, 22 Feb 2004 18:41:35 GMT
At 12:38 PM 2/22/2004, j.p.waterhouse@btopenworld.com wrote:

>Thank you for replying.

My pleasure Jack, good karma for when I ask a question. :)

>Actually, I'm writing the CGI program in C, rather than Perl.

Hmm, I may be the wrong guy to help here but will give it a shot..

>I'd like the CGI program to process some stuff in a form, and then load a 
>page. The page has a lot of SSI on it, so I can't just open the file and 
>print it. I need httpd to parse it and serve it up.

Sounds like the page is on your server right? So you're looking for a way 
to grab the result of URL on your own server, and since it's got SSI's on 
it you can't just grab the local file, is that right?

As said, Perl does this easily and I don't know C enough to know what it 
can offer for this need. If I had to do this therefore I'd just write a 
Perl pgm on say /home/jack/perl/getURL.pl

#!/usr/bin/perl

use LWP::Simple;
get 'http://myserver/myurl/';

__END__

Then within your C cgi pgm do a system call to getURL.pl and store the 
result. The perl script will capture apache's response to the get request, 
including any parsing of course and return the result just the same as for 
any other user agent. If you need to post instead of get that can be done 
as well, just a little bit more complicated.

BTW afaik the only significance of this being on a local server is that you 
might use localhost instead of the Internet domain name in crafting the URL 
to get if you think that might conserve bandwidth.

hth,

Marty Landman   Face 2 Interface Inc 845-679-9387
This Month's New Quiz --- Past Superbowl Winners
Make a Website: http://face2interface.com/Home/Demo.shtml


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message