Gossamer Forum
Home : Products : Links 2.0 : Customization :

SSI integeration into CGI generated pages

(Page 1 of 2)
> >
Quote Reply
SSI integeration into CGI generated pages
How can I use SSI tags in CGI generated pages such as search results? I searched for similar messages but I could not find any that can help me. IF any one knows a step by step instruction please let me know.

Kind Regards

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Search this forum for header and footer and you will find Threads that explain how to include additional files in your .cgi scripts.

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
I have been searching for hours and no result. There are many topics on SSI but non answer my question.

I have to call this /cgi-bin/advert/remote.pl?region=big125&mode=SSI CGI script and I dont know what to do. I use SSI on static pages but doesnt work on CGI generated pages. Any help?

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Well...then try searching this forum for WebAdverts and you will find Threads that provide codes that you will need to include other CGI scripts within your Links CGI scripts...trust me...this has been discussed numerous times in this forum.

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
but I am not using WebAdvert!

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Then adapt the codes you have for this other CGI with the same codes you are using with WEBADVERTs.

Good luck!

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Its different all I want to do is to call a one line cgi file thats all.
If some one can tell me how I can call up a CGI file without using SSI I will be fine.


Quote Reply
Re: SSI integeration into CGI generated pages In reply to
If it's just a one-liner, just put in your script somewhere as a subroutine or variable (ie, site_html[_templates].pl), then define the it in the %globals hash (or the hash for just one template) of tags/variables to use in your templates...
Code:
something => \&something,
or
Code:
something => $something,
(remove the ',' if this is the last variable.)

--Drew
Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Ok this is what I did and It doesnt work :(

first I edited site_html_templates.pl by adding
header_links => &header_links, to global
Then I added
sub header_links {
# -----------------------------------
# This is the header file to insert into your LINKS pages.
open (INC, "/big/dom/xweb_toolz/cgi-bin/advert/remote.pl?region=big125&mode=SSI") or return "Can't find include file: header_links.txt";
return join ("", <INC> );
}

I keep getting "Can't find include file: header_links.tx" If I remove the "?region=big125&mode=SSI" from the
end of cgi file then it just prints the content of cgi file. I have been working on this for hours and I am simply going crazy. Any help?

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
I guess you did not understand me when I said to use similar codes as WebAdverts....

Try the following sub-routine:

Code:

sub header_links {
#---------------------------------------------------------
# Insert CGI file
my $ad = `/big/dom/xweb_toolz/cgi-bin/advert/remote.pl?region=big125&mode=SSI`;
$ad =~s,Content-type:\stext/html,,;
return $ad;
}


Keep the globally defined tag....

NOTE: Copy the codes as is....Don't switch the ` character with single quotes.

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
kickster -

Try this simple and very effective script to run ssi and any other html code in cgi scripts. You can download it from here ftp://ftp.huntseek.com/html-rotater-1.0.zip . I did not write it.

Jerry


Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Oh God :( It still didnt work. You see the script looks for remote.pl?region=big125 which doesnt exist.
the file name is remote.pl and ?region=big125 is the extension. For some reasons this way of calling this file
does not work. Is there any way that I can use the URL instead of server path?

Thanks in advance

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
The only other less reliable and non-interoperable solution is to use <IFRAME></IFRAME> tags...these will not work in Netscape.

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
How do you use this program? How can I use it to call my CGI file?

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
It is not a program...they are HTML codes....

Like the following:

Code:

<IFRAME SRC="/cgi-bin/yourscript.cgi?review=something">
</IFRAME>


Yet again, you should be aware that this anchor is not supported in Netscape....Read the following web page:

Netscape Standards Challenge
http://home.netscape.com/...uture/standards.html

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Ok. what about using $exec = `/path/to/program`; does this work?
Why is it that the cgi file remote.p worked with your solution but as soon as I add the ?region=big125
to it it stops working? I am sure there must be a way to call a CGI file.

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Eliot,
My understanding is that you can use ILAYER for Netscape in the same manner as IFRAME for Explorer. You would just have to include tags for both browsers.

--Drew
Quote Reply
Re: SSI integeration into CGI generated pages In reply to
That is correct....if you want to make sure that you are using interoperable anchors, you could use the following codes:

Code:

<SCRIPT LANGUAGE="JavaScript">
function getBrowser() {
if (navigator.appName.indexOf("Netscape") !=-1)
if(navigator.appVersion.indexOf("3") != -1)
return 1
if (navigator.appName.indexOf("Netscape") != -1)
if(navigator.appVersion.indexOf("4") != -1)
return 1
if (navigator.appName.indexOf("Microsoft") !=-1)
if(navigator.appVersion.indexOf("3") != -1)
return 2
if (navigator.appName.indexOf("Microsoft") !=-1)
if(navigator.appVersion.indexOf("4") != -1)
return 2
}
if (getBrowser() ==1) document.write("<ILAYER SRC='/cgi-bin/script.cgi?something'></ILAYER>");
if (getBrowser() ==2) document.write("<IFRAME SRC='/cgi-bin/script.cgi?something'></IFRAME>");
</SCRIPT>


Of course...this is a bit messy, since the codes would have to go within the web page and not loaded in the header portion of the file.

Regards,

Eliot Lee

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Kickster,

I'm the author of AdvertPRO, notice you were trying to get it working in your CGI script. The best way to use remote.pl in a CGI script is to take the needed parts of remote.pl and put them in your CGI script.

You should do something such as follows:

# Load the LWP::Simple module.
use LWP::Simple;

# Use LWP::Simple to retrieve the banner.
$html = get("http://www.yoursite.com/cgi-bin/advertpro/banners.pl?region=NAME_OF_REGION&mode=SSI");

# If an error has occured, display this error message.
$html ||= "[an error occurred processing this request]";

# Display the ad banner.
print "$html\n\n";

Now, this requires you to have LWP::Simple installed, however that is a requirement of remote.pl so I'm sure that's not a problem. You will need to change the URL of banners.pl in the code above and also replace NAME_OF_REGION with the name of the region you want to display.

Hope that helps!

Sincerely,
Mike Cherichetti

http://www.advertpro.com
http://www.arc-s.com

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
jerry
huntseek ftp requires user/password to get the html-rotator script. do you know what should be used? can you post the program without any copyright violations?



Quote Reply
Re: SSI integeration into CGI generated pages In reply to
It's free for distribution. And a password should not be needed to download. But you should have your options set up to use anonymous login's.

I just tried it and it worked with no problem.

Jerry


Quote Reply
Re: SSI integeration into CGI generated pages In reply to
In the script you want to place your banner you will have to place the required statement, i.e. require="your/path/to/the/script". Then where you want the banner to be placed in the script just put $mybanner.

But remember to follow the directions with the script.

Jerry


Quote Reply
Re: SSI integeration into CGI generated pages In reply to
Hi Jerry
I dont understand how to use that script! Can you explain in details what I should do?
Thnaks

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
I am not sure if I got this right So in order to use that script:

I make a Sub section

sub header_links {
#---------------------------------------------------------
# Insert CGI file
require 'path_to_the_banner_library/banner-lib.pl'; # loads the library
$my_banner = &get_next();
}

then in Banner-lib.pl

#####################################################################################
# Chatologica HTML Rotator v1.0 - banner-lib.pl - the main library
# All rights reserved (c) 2000; http://www.chatologica.com/
#####################################################################################
use strict; # use strict programming pragma
srand(); # generate new random numbers
my @banners = (); # allocate the banners database

# To add new banner account simply add perl code like this:
# push @banners, <<'endofhtml';
# here goes the html code of the new banner account
# endofhtml
# NOTE: endofhtml string must start on new line and finish with new line / carriage return
#
# to remove banner account - remove its code

push @banners, <<'endofhtml';
http://www.web-toolz.com/cgi-bin/advert/remote.pl?region=big125&mode=SSI
endofhtml

# USAGE: $banner = &get_next(\%in, \@modules);
# or simply:
# $banner = &get_next;

sub get_next # returns random html banner code
{
my($in, $modules) = @_;
my $random = int rand($#banners + 1); # generates a random number from 0 to $#banners
return $banners[$random];
};



1; # this library must return TRUE


and then add <%header_links%> tag where I want the banners to show.

I am too confused over this.

Quote Reply
Re: SSI integeration into CGI generated pages In reply to
How to if the file I want to is .php?

Love you all,and thank for all help here ,this is a greatest forum.
Act.
> >