[ic] include ssi perl code

Joachim Leidinger interchange-users@interchange.redhat.com
Tue Feb 26 19:37:00 2002


Vutura - Internet Multimedia Werbung wrote:
> 
> Hi there,
> 
> i have really some probs to embed a perl coded script into a interchange shop.
> I read really all mailings - i think - but i found no way!
> 
> i have a poll script (xpoll.pl) which is for making a poll for the users.
> It is a really nice script and it works, if a call it directly (in the cgi-bin) or from a shtml
> page.
> 
> now i really donīt know how to include this script in the interchange shop!

Call it directly and send them the session id of interchange and make
sure, that script can call back a special interchange page and send them
the former session id back and show the result of that script!

> i tried so many ways - i get crazy - i think...
> 
> - include seems not to be for perl scripts

Of course! It is a different between cgi and any kind of included stuff
like ssi, php or whatsoever in any html pages, which will be parsed by
the weberserver first.....

> - in globalsub & [pearl][/pearl]

[perl][/perl]

>   i get no error messages so it is very difficult to change the script

Of course! You will never get any error message, if you are calling
anything outside of interchange!

>   - it needs some config files - and i donīt know the dir...

Why?

>   - it uses print instead of return

And what is the problem? Change it to return! Store all the output like

my $out = '';
....
$out = "The first answer";
...
$out .= "The second or xyz. answer...";
...

and send it with

return $out;

> - the ssi.pm seems no more to be downloadable - because the link fails.

SSI is not the same as CGI! That is a big different!

> - the executer is a java implementation and i donīt like java at all - so i didnīt try it.

I've a simple little script, wich is calling by IC and that script is
connecting to the java server and send them any datas, get any datas
from that java server and send the results back to IC, with calling a
special ic pages by the get methode.

> - even my normal html files allow ssi now - but not ic

You dont know the different between SSI and CGI! :-)
 
> what about untrapping?

Why? Search for the answer! What is a SSI and what is a CGI? What is the
different for a webserver? You will get the picture!

> i have a apache 1.3.19 server

I too! But, I use not ssi! I use a lot of perl script from the
interchange pages!

> maybe someone knows some more...

If you have that script working well, why not calling that script
directly? If there are a problem with the right session id of IC, why
not send the session id of interchange to that polling script and get
back the right session id of that script or that polling script call the
special interchange page and send them the session id and the datas?

Hint:
To get any values by the get or post methode, you can get that with

[seti myvar1][cgi mypollvar1][/seti]
[seti myvar2][cgi mypollvar2][/seti]
...

If you are familiar with cgi and ssi, you would recognize the *big*
different between cgi and ssi. SSI is a server side include, which will
done by the webserver itself and cgi is not done by the webserver
itself. The webserver will call that cgi (and send them some values) and
is waiting for the feedback. A html page with ssi will be parsed by the
webserver itself. For a calling link/url to the cgi script, the
webserver start that script and send them the values (if there are some
values to send to that script) and is waiting for the respond of that
script to send the datas to the client back and will not parsing any ssi
of any pages, which is coming from any kind of the cgi program. 

For example:

1)
A static page has ssi in a static directory -> OK
because...apache read that page and parse it...

2)
A cgi program build a html page *with* ssi -> NOT OK! 
because...apache is starting the cgi program and is waiting for any
respond of that program. Not any more!

With cgi, the webserver is calling that script and send them any value,
if there are some values to that cgi script as an url or link.

If a polling script is very simple, why not create the same with some IC
pages too?


ciao

jojo

-- 
Hans-Joachim Leidinger | Dipl.-Phys.Ing. Entwicklung eCommerce
[leidinger@bpanet.de] 
Black Point Arts Internet Solutions GmbH
http://www.bpanet.de