Gossamer Forum
Home : Products : Gossamer Links : Discussions :

SSI in Link SQL?

Quote Reply
SSI in Link SQL?
In one of the templates I used...

<!--#echo var="REMOTE_ADDR"-->
which runs in search.cgi

server does not do server-parsed on cgi, so I get
<!--#echo var="REMOTE_ADDR"--> as output in webpage


to be more precise I am trying to use...
<script LANGUAGE="JavaScript"><!--
var userip = "<!--#echo var="REMOTE_ADDR" -->";
document.write(userip);
//--></script>


I modified .htaccess in search.cgi directory to ...

Options +ExecCGI
AddHandler server-parsed .cgi .pl

AddHandler cgi-script .cgi .cgi

Can Javascript get remote IP address w/o SSI?
Is their any linksql variable to get ip address?
if none... then can above .htaccess settings be used to get IP address, as currently either it does not process SSI in cgi or it shows source code of CGI w/o processing script?
Quote Reply
Re: [jasy007] SSI in Link SQL? In reply to
You can't use SSI in the templates since the output doesn't get parsed by the SSI engine. You'll need to write a global and add the tag into your templates. The global would be a simple: return $ENV{REMOTE_ADDR}; global.

Adrian
Quote Reply
Re: [brewt] SSI in Link SQL? In reply to
In Reply To:
You can't use SSI in the templates since the output doesn't get parsed by the SSI engine. You'll need to write a global and add the tag into your templates. The global would be a simple: return $ENV{REMOTE_ADDR}; global.

Hi,
could you mind explaining little more... where & how to add 'global tags'... I did search but couldn't get specific information?
Quote Reply
Re: [jasy007] SSI in Link SQL? In reply to
The manual describes how to use the globals manager (around page 53). Add a global and give it a name (say remote_addr) and then for the 'description' enter:
Code:
sub {
return $ENV{REMOTE_ADDR};
}

Then in the templates, just use <%remote_addr%> where you want the REMOTE_ADDR text.

Adrian
Quote Reply
Re: [brewt] SSI in Link SQL? In reply to
Thanks a lot Adrian, that was helpful Smile