Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityEverything ElseGeneral Use (Moderators: scott, DanO, Marty)Executing SSI mode within PHP doesn't work
Pages: [1]   Go Down
Print
Author Topic: Executing SSI mode within PHP doesn't work  (Read 314 times)
0 Members and 1 Guest are viewing this topic.
sethp
New Member
*

Karma: 0
Offline Offline

Posts: 0

Technical Writer


« on: December 21, 2003, 09:47:00 PM »

I'm converting my home page from HTML to PHP. On my current index.html home page I call the calendar.pl as a server-side include so it just uses the tiny mode and I set it to list event for the next ten days on the calendar. I want this same effect on my new index.php home page.

When I try to do the same thing from within a PHP file, like this [the only way I can get it to work at all is by using the full domain in the include()]:
<?php
include("http://domain.com/cgi-bin/calendar.pl");
?>

... it executes the full calendar.pl script and displays the full calendar in normal mode, not in SSI mode.

Do any of you have any experience with using the SSI mode and know whether or not it can work that way when called as a php include()?

Any ideas would be appreciated!!

------------------
seth.

Logged

seth.
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: December 22, 2003, 01:57:00 PM »

** ... it executes the full calendar.pl script and displays the full calendar in normal mode, not in SSI mode **

You'd have to also pass all the variables calendar.pl needs to execute the appropriate template like as seen in the SSI 'include virtual' example in the previous forum message "SSI head ache!".

Dan O.

------------------

[This message has been edited by DanO (edited December 22, 2003).]

Logged
sethp
New Member
*

Karma: 0
Offline Offline

Posts: 0

Technical Writer


« Reply #2 on: December 22, 2003, 03:29:00 PM »

Awesome! Thanks, DanO.

It's working like a charm now. I didn't know about the variables that were passed. I couldn't reverse engineer the SSI mode to figure out what it needed to actually work.

You can see my implementation of the SSI small version on the front page at http://packhams.com  

------------------
seth.

Logged

seth.
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: December 22, 2003, 06:41:00 PM »

** I didn't know about the variables that were passed. I couldn't reverse engineer the SSI mode to figure out what it needed **

JFYI. From the CalendarScript documentation under Advanced Usage > SSIs    

quote:
Arguments cannot be passed to CGI scripts running in an SSI environment on most servers. Therefore, another method must be used to pass preferences (such as which template file to use for formatting the output) to the script. Therefore, if the script is run and detects that it is running via an SSI call, it will look for a file called 'ssi.txt' in the 'calendarscript' directory. This file should contain any arguments that the script should process, such as defining which calendar to use, which template, etc. An example of this can be as simple as:
template=ssi.html

All you probably needed to do was look in the 'ssi.txt' file.

** You can see my implementation of the SSI small version on the front page **

Looks nice! Glad to hear you got it working.

Dan O.

[This message has been edited by DanO (edited December 22, 2003).]

Logged
sethp
New Member
*

Karma: 0
Offline Offline

Posts: 0

Technical Writer


« Reply #4 on: December 22, 2003, 09:28:00 PM »

Ahh. So when I was using a <!--#include virtual=""--> in my html, my server "detected" that it was running as an SSI and looked into my ssi.txt for the parameters and template. But when I switched to using the php virtual() tag to call the include, it somehow didn't do the detecting the same so I had to include the parameters in the actual php.

It's literally been two years since I installed this script and had it running. It was hard to go back and try to remember what I had done to get the SSI smaller version running again.

Thanks again.

And kudos should go to this script. I haven't found an equally impressive, easy-to-use, and powerful calendar script that uses PHP and MySQL. This calendar has intelligent event repeating options that many calendars don't consider.

------------------
seth.

Logged

seth.
Pages: [1]   Go Up
Print
Jump to: