Forum: Geek Forum
Topic: SSI's in PHP
started by: Spydir Web

Posted by Spydir Web on Mar. 24 2001,21:50
ok... this has been bothering me for awhile... how do I get a SSI into a PHP file with out editing httpd.conf (this is on my webhost so I can't change filename things).

I know how to do SSI's and stuff, it's just I have to put one into news.php so that the page'll have my layout stuff, but SSI's have to be in .shtml files ... I asked my webhost and they haven't responded with anything, and that was a couple weeks ago.

------------------
Spydir Web - < http://netsyndrome.net/spydirweb/ >
Net Syndrome - < http://www.netsyndrome.net/ >

Sometimes you're the dog, sometimes you're the hydrant...


Posted by incubus on Mar. 25 2001,03:08
I dont know PHP but I know Perl - if theyre similar then why bother with a SSI? Surely you can just open the text file in PHP and use it in the HTML output? If you're dealing with newspro I think it chucks out text files, surely you can just open the file and parse it as part of PHP?

Just my 2 cents, remember i don't know php

Mike

------------------
-- incubus
As I chase the leaves like the words I never find ...


Posted by cr0bar on Mar. 25 2001,04:56
You don't need to use SSI calls if your pages are being parsed for PHP, just use include():

include "/path/to/file.inc";
-or-
include("/path/to/file.inc");

If you need to exec cgi, use virtual():
virtual("/cgi-bin/newspro.cgi");

You can only parse for multiple preprocessors (i.e. SSI or PHP) in Apache 2.0 and higher, but it's still in beta.


Posted by Spydir Web on Mar. 26 2001,00:38
what I'm doing is a dinky little weblog. It uses news.php to add news, and latest.php to list the 5 newest articles, which reads from article_summary.html for the list of articles. What the SSI is supposed to do is something like <!-- #include "lasest.php" --> to list the news. I've tried the include() thing but it don't exactly work, and I made lastest.php output to a variable and I tried echo'ing the varible, but that doesn't work either. I'm probably doing something wrong, but if you can understand that "help a brovah out, y0"...

------------------
Spydir Web - < http://netsyndrome.net/spydirweb/ >
Net Syndrome - < http://www.netsyndrome.net/ >

Sometimes you're the dog, sometimes you're the hydrant...


Posted by KL1NK on Mar. 27 2001,18:58
speaking of php....is < http://www.php.net > down for anyone else?
Powered by Ikonboard 3.1.4 © 2006 Ikonboard