SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
-
Sep 23, 2000, 13:33 #1
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I need apache to parse *.html and *.php for PHP & SSI.
What should i add ?
at the moment i have :
AddType application/x-httpd-php3 .php
AddType application/x-httpd-php3 .html
addType text/x-server-parsed-html .html
When i use a .html, it doesn't parse for php.
What should the correct code be ?
Thanks
James
-
Sep 23, 2000, 13:35 #2
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
To my knowledge, you can't parse a single file type for both PHP and SSI. You'll have to choose one or the other.
Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
-
Sep 23, 2000, 13:39 #3
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
damn.
ok, well how do i get the effect of SSI to run a script.
at the moment i have this :
<!--#include virtual="/stato/stats.cgi"-->
how can i get this effect in PHP ?
<?php require("/stato/stats.cgi"); ?>
is it that ?
-
Sep 23, 2000, 13:46 #4
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Normally, you'd just do:
include('filetoinclude.php');
But since the file you're including is a CGI that must be processed, you should instead use
passthru('/path/to/script.cgi');Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
-
Sep 23, 2000, 13:52 #5
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
that isn't by any chance only PHP4 ?
-
Sep 23, 2000, 14:16 #6
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
No, but it's only on the Apache module version of PHP (i.e. won't work with the CGI version).
What problem(s) are you having?
Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
-
Sep 24, 2000, 05:21 #7
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
well, it just returns a page with this code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
Instead of what Statomatic should return, which is this :
<!-- Statomatic v2.2 -->
The code I'm using is :
<?php passthru("/stato/stats.cgi"); ?>
-
Sep 24, 2000, 05:35 #8
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
OK, passthru wasn't working.
I asked someone in #php on efnet, and they suggested using
virtual();
this works fine.
thanks
james
-
Sep 25, 2000, 11:13 #9
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
using virtual(); seems to work, but i seem not to be getting some of the stats. eg referer.
is this because of not using SSI ? would using this method provide exactly the same method as using SSI ?
-
Sep 25, 2000, 20:10 #10
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
It's quite possible that some of the request-specific environment variables are not available to a CGI called with virtual(). This function is equivalent to <!--#include virtual...--> using SSI.
In an ideal world, you would port your CGI to PHP; however, I assume this is beyond your experience?
Kevin Yank
CTO, sitepoint.com
I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
Baby’s got back—a hard back, that is: The Ultimate CSS Reference
-
Sep 26, 2000, 02:33 #11
- Join Date
- May 2000
- Location
- London
- Posts
- 283
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Unfortunately not. Plus, its a pre-compiled C++ script.
Guess I'll have to use the javascript image tag version. But this messes up the layout. Doh !
Bookmarks