Calling SSI into Html

Started by RebelRose, September 04, 2006, 02:37:59 AM

Previous topic - Next topic

RebelRose

Can someone tell me if this is the correct way to call this function to put into html.


<?php

require_once('path/to/SSI.php');

ssi_recentTopics();

?>

winrules

That is correct, but you have to either give the html page a .php extension or modify .htaccess.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


RebelRose

Quote from: winrules on September 04, 2006, 10:19:04 AM
That is correct, but you have to either give the html page a .php extension or modify .htaccess.

how do you modify htaccess?

B Patterson

You wouldn't want to modify .htaccess as if you did, you'd have to specify HTML as a server interpreted language.  What you would want to do is create an HTML file and do the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> << :: SMF SSI.php 1.1 RC2 :: >> </title>
</head>
<body style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;">
<h1>SMF SSI.php Functions</h1>
Current Version 1.1 RC2<br />
<br />
This file is used to demonstrate the capabilities of SSI.php using SHTML include functions.<br />
The examples the include tag, then the results of it. Examples are separated by horizontal rules.<br />

<hr />

<h3>Recent Topics Function: &lt;!--#include virtual="./SSI.php?ssi_function=recentTopics" --&gt;</h3>
<!--#include virtual="./SSI.php?ssi_function=recentTopics" -->

<hr />


So basically, use server side includes calling a function from the include line.  Then, you just have to use the extension shtml instead of html and you're good to go.

Look to ssi_examples.shtml for more information & examples.

JayBachatero

If you go the php route you have the option to modify the output.  If you do go that way you have to add

<?php require_once('path/to/SSI.php'); ?>


Right bebore the <html> and <!DOCTYPE> tags.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

RebelRose

that you I will give that  a try

RebelRose

Quote from: Jay The Code Monkey on September 04, 2006, 11:33:49 PM
If you go the php route you have the option to modify the output.  If you do go that way you have to add

<?php require_once('path/to/SSI.php'); ?>


Right bebore the <html> and <!DOCTYPE> tags.

I just want to add recent topics to a html page, on my main site, that is all done in html. my forum is smf, but I wanted to add that.

JayBachatero

Yeah I know but if you go with naming the file to .php you have to put the call to SSI.php before anything else.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: