Problems With <!--#include Virtual="


EvilDragon

Administrator
Staff member
Joined
Mar 4, 2003
Messages
29,986
Age
46
Location
Ingolstadt
Well... I have some problems I can't figure out...

I tried to include some SSI into part of my new webpage... but I always get the error "[an error occurred while processing this directive]"

I enabled EXECCGI via .htaccess, the script path is correct (and working fine whenever I run it directly from the browser) and SSI is definately enabled, as the same SSI (which runs on my server gp32x.de) is being executed from the gp32x.de frontpage...

I just can't figure out why it won't run from my gpx2.de server...?

I tried running it using:
<!--#include virtual="http://www.gp32x.de/cgi-bin/ssi/gp32recent.cgi"-->
or
<!--#exec cgi="http://www.gp32x.de/cgi-bin/ssi/gp32recent.cgi"-->

Any ideas?
 
Last edited:
Delsabre posted on Aug 4 2005 at 05:29 PM said:
possibly the compiler cant handle http paths?

try using relative paths

As the scripts are on a different server, I can't use relative paths... well, I would have to change the complete environment, but first I'm trying to use a simple CGI script as a test for relative paths.

Thanks.
 
Last edited:
EvilDragon posted on Aug 4 2005 at 05:05 PM said:
Delsabre posted on Aug 4 2005 at 05:29 PM said:
possibly the compiler cant handle http paths?

try using relative paths

As the scripts are on a different server, I can't use relative paths... well, I would have to change the complete environment, but first I'm trying to use a simple CGI script as a test for relative paths.

Thanks.

You can't include a file from another server like that. You could write a script which uses GET to store the output of that file in a variable and then display that.
 
Last edited by a moderator:
chris posted on Aug 4 2005 at 07:16 PM said:
EvilDragon posted on Aug 4 2005 at 05:05 PM said:
Delsabre posted on Aug 4 2005 at 05:29 PM said:
possibly the compiler cant handle http paths?

try using relative paths

As the scripts are on a different server, I can't use relative paths... well, I would have to change the complete environment, but first I'm trying to use a simple CGI script as a test for relative paths.

Thanks.

You can't include a file from another server like that. You could write a script which uses GET to store the output of that file in a variable and then display that.

Hmm... I wonder how hando did that, as he uses my SSI CGI Scripts on gp32x.de and displays it at the frontpage of gp32x.de...
 
Last edited:
He probably uses PHP to open your include and insert it into the page. You can do it pretty easily:

Code:
echo file_get_contents("http://www.gp32x.de/cgi-bin/ssi/gp32recent.cgi"); // or whatever

One solution if you don't have PHP or Perl installed on your home page server, is to use your files server to generate a JavaScript file much like this:

Code:
document.write('&nbsp;[ATTACH=full]16432[/ATTACH] <A class=lista_download HREF="http://www.gp32x.de/cgi-bin/cfiles.cgi?0,0,0,0,20,422">FreeSCI</A> <font class=lista_download>(411.4 KB)</font><br>');
document.write ...

Then include this javascript file with the standard tag:

Code:
<script language="Javascript" src="http://www.gp32x.de/cgi-bin/ssi/gp32recent_js.cgi"></script>

This should work although you may only be able to use .js files as the src, I'm not sure. Plus it obviously requires Javascript to work but most users have it enabled.

Don't ask me why SSI doesn't do remote includes but JavaScript does :)
 

Attachments

  • strzalka_download.gif
    strzalka_download.gif
    64 bytes · Views: 127
  • strzalka_download.gif
    strzalka_download.gif
    64 bytes · Views: 104
Last edited by a moderator:
Cool, Rico, thanks a bunch!

As I have a dedicated server, I can run what I want on it, and PHP is already up :)

I just put the SSI files on the same server and didn't use an external one, but I'm sure your explanation will be of use again.
I'm also thinking about a page only showing the latest files for all of my archives... and THAT'S exactly where I need this :)
 
Back
Top