Forum Moderators: coopster

Message Too Old, No Replies

SSI to PHP

         

stcrim

3:16 am on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a way to parse SSI on pages that end in PHP?

I have an include that needs to go on a .php page for a tracking system.

<!--#include virtual="/cgi-bin/traxis/traxis-counter.cgi?site=tracking"-->

Any suggestions?

-s-

timster

3:34 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP has its own include functions, which you probably want to use instead of SSI.

SSI isn't very flexible, as you seem to be finding, and since the pages are PHP anyway (with the overhead that that implies) I don't see a reason not to use the PHP include.

Then, you'll be able to do things like conditional includes, if you ever need.

jonknee

4:09 pm on Aug 19, 2003 (gmt 0)

10+ Year Member



Your best bet is to use either exec() or passthru() (depending on what the CGI does). Include won't work here since you need to execute a program, not just add in a text file.

But yes, PHP's include() is much nicer for just footers/headers/common code blocks. Forget SSI--it's passé.

timster

6:58 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oops, I missed that it was a CGI.

Is the CGI just a short Perl script? It may be easer/quicker just to port it to PHP. Then you're not spawning CGI processes, in case you care about such things.

stcrim

7:12 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope - it's a rather large script

-s-

jonknee

8:39 pm on Aug 19, 2003 (gmt 0)

10+ Year Member



Timster is right about the spawning processes statement. If the site is pretty low-traffic, you'll have no problems (other than your webhost if they look down on such things). However, if you have a few hundred hits an hour it will start to become a bottle neck.

Since you have a server that does PHP, you should probably be able to do without the counter. Use a log analysis program.

stcrim

9:18 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's a little more than a counter!

It's the finest web site tracking system on the face of the earth.

[searchengineworld.com...]

-s-

jonknee

12:44 am on Aug 20, 2003 (gmt 0)

10+ Year Member



Well, looking at the output, it sure isn't the best designed system. That's not to say it doesn't kick :)

I've always had good luck with webalizer--especially with speed. But, I'll have to look into it.

jatar_k

4:30 pm on Aug 20, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



<completely OT>
no offence intended but webalizer doesn't hold a candle to traxis. Traxis is the best analysis program there is, from what I hear and know, for what we do.

The first thing I do when someone shows me webalizer reports is ask for logs so I can run it through anything else.
</completely OT>

from what I can tell this script does a fair amount of work and needs a lot of data that wouldn't be available using exec or passthru. It may need to be rewritten in php to work. It looks like a stand alone section of the product so the rest could remain in perl.