News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

php include SSI.php from a different domain?

Started by Mayhem30, August 05, 2008, 12:15:35 AM

Previous topic - Next topic

Mayhem30

I have a forum on one domain but would like to include the SSI.php from another domain (so I can show recent posts).

<?php
include("http://www.domain.com/forum/SSI.php");
ssi_recentPosts($num_recent = 20, $exclude_boards = array(), $output_method = 'echo')
?>

I get an error ..

Please don't access SSI.php by URL directly; you may want to use the path ('SSI.php') or add ?ssi_function=something.

How can I fix this issue?

Mayhem30

I just wanted to add that I have already tried :

/home/httpd/blah/blah/blah/httpdocs/forum/SSI.php for the include and still get no results.

I would really appreciate any assistance on this!

Nathaniel

#2
Well, you should never try to include php files from other domains/servers by using their urls for security reasons.

I would recommend that you try to use the absolute server path ("/home/httpd/blah/blah/blah/httpdocs/forum/SSI.php") again, it should work. You should double check the path to make sure its right, because if you get the path right then it should work. The only reason that I can think of for that not working, is if your SSI.php file has errors. If you got any other errors then please post them, because there may be an issue with your SSI.php file.

Hmm, you could also try adding the ?ssi_function=function, to see if it works for a particular function.

You could also trying using RSS, if you only want to get a list of new posts or something similar.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Minare

I don't know if this will help but I hope so:

Quote from: Elmacik on November 09, 2006, 07:12:40 PM
You can use in another host. If you will use SSI in php :
implode('', file('http://www.yoursite.com/forum/SSI.php?ssi_function=recentTopics'));

If you will use SSI in SHTML ::
<!--#include virtual="http://www.yoursite.com/forum/SSI.php?ssi_function=recentTopics" -->

If you will use SSI in html, open an iframe and link as :
http://www.yoursite.com/forum//SSI.php?ssi_function=recentTopics

recentTopics function is just an example, u can use any function.

says in a turkish topic

lordtron

Wow if that really works, that could just be amazing. That would help out a lot.

VainSoftGames.com - New Design To Gaming

Mayhem30

That worked nicely  :)

I do have a question though ..

<?php include ("http://www.mysite.com/forum/SSI.php?ssi_function=recentTopics");?>

How do I make it show the last 15 topics? It's only showing 8 by default.

Minare

Check these topics, they will help you understand more functions I guess, u can find examples as well, and I am happy it worked =)

Basic SSI FAQ
Advanced SSI FAQ
Expert SSI FAQ

Mayhem30

The only way I was able to get it to work was modify the SSI.php and change the topics part to display 20 instead of 8.

I wasn't able to figure out how to do it the other way. Your links didn't cover it.

It's all good though, it works now just fine.

lordtron

Yeah I tried your You can use in another host. If you will use SSI in php and it didn't work for the login function of ssi

VainSoftGames.com - New Design To Gaming

Advertisement: