Well here's the thing. Script 1 is connected to my forum. As new posts are added, it displays them. I want to include the HTML output of Script 1 on my website (located in a different directory).
Is that enough info?
<?php
// Recent Posts Plugin
// By Rogem
// Version 1.0
define("IN_MYBB", 1);
define("KILL_GLOBALS", 1);
define("NO_ONLINE", 1);
// The Directory to the forum you are using this on.
// You do not need a beggining or trailing slash
$directory_to_forum = "";
require dirname(__FILE__)."/".$directory_to_forum."/global.php";
$plugins->run_hooks("Recent_Posts_Plugin_run");
?>
Ugh. That does not sound like fun (I'm a design type after all...)
Great advice. I had over complicated everything. I ended up writing my own script and everything works great now.It may not be fun, but it's probably the most direct way to handle your question if I'm understanding it correctly. It's not that bad either. Perhaps you should consider the overall effect you're going for and think of a new direction to solving it. Some times things are hard because you're taking the hard approach
<?php
include('path/to/filename.php');
?>
I'm trying to include the HTML output of one PHP file into my new PHP file. Is this possible?
<?php
require("path_to_my_other_php_file.php");
?>
The documentation below also applies to require().
The two constructs are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless.