News:

Wondering if this will always be free?  See why free is better.

Main Menu

Need Help with SSI

Started by myndcraft, December 09, 2005, 01:32:50 PM

Previous topic - Next topic

myndcraft

I would like to show the recent posts on webpage. The problem is the websote is hosted on a different box then the forums. So made a test webpage that looks like this..

<?php

require("http://denovoforums.org/forums/SSI.php");

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>

<h3>Recent Topics Function: &lt;?php ssi_recentTopics(); ?&gt;</h3>
<?php ssi_recentTopics(); ?>

<h3>Recent Posts Function: &lt;?php ssi_recentPosts(); ?&gt;</h3>
<?php ssi_recentPosts(); ?>

</body>
</html>


but when I load the page it returns this:

Please don't access SSI.php by URL directly; you may want to use the path ('SSI.php') or add ?ssi_function=something.
Recent Topics Function: <?php ssi_recentTopics(); ?>

Is there any way to work around this since the site and forums don't live on the same box?

Thanks in advance.

myndcraft

/bump :-)

hate to do that, but just hoping someone who may have not seen this has an idea around the problem.

kegobeer

You can't include a file from a different webserver.  You should look into using RSS feeds.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Thantos

Well you "can" include a file from a different webserver.  However the problem you are running into is that what you are including is not the PHP code that you need but the output from the PHP engine on that server.

kegobeer

Let me clarify: you can't use an include or require statement to grab php files from another webserver.  If that was the case, there would be absolutely no security on the web.
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

Thantos

You can't use include or require to grab unparsed php files.  Slight difference :)

oxynom

Take advantage of IFRAME then...

Create a page on the server where your forum is and include the ssi file and call the functions you want to use...let's this page is called recent.php.

Now use IFRAME on the other server to display the file recent.php.

<iframe src="http://www.yourserver.com/recent.php"></iframe>

You might wanna use height and width (etc...) atributes to control the size of the frame.
If you are a little interested in Travel then visit my Project.
SMF 1.1 RC2 bridged with Coppermine and heavily modded.
Destinedia - The Shrine of Travel [nofollow]

gerrymore

Try using the absolute path to ssi, not the domain. It's available from the top of your ssi_examples.php.


require("http://denovoforums.org/forums/SSI.php");
SMF RC1, Tiny Portal 0.75, Coppermine 1.3.3, Flashchat.

Advertisement: