I see what your saying, your trying to use POST from the script you included to show the script again with the test results while still showing the CMS layout and functions, this could very well be an issue.
I havent experimented with this tag yet, as im sure there is a way to include at least the header and the footer inside the script when you execute it, let me look at the code real quick and see if I can find a solution...
*looks*
Ok I found a solution, but it is not for newbies.
In index.php (from the phpwcms core), you need to basically separate it into two files, header.php and footer.php, both being in your base phpwcms directory.
Copy the following to
header.php:
Code: Select all
<?php
/*************************************************************************************
Copyright notice
(c) 2002-2003 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
This script is part of PHPWCMS. The PHPWCMS web content management system is
free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
A copy is found in the textfile GPL.txt and important notices to the license
from the author is found in LICENSE.txt distributed with these scripts.
This script is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
// this is for testing only
// returns how long this script is processed
// remove comments // to use this - look at the end of this
// page too
//
// require ("include/inc_lib/ext/phpsniff/phpTimer.class.php");
// $timer =& new phpTimer();
// $timer->start('main');
require_once ("include/inc_conf/conf.inc.php");
require_once ("include/inc_lib/default.inc.php");
require_once ("include/inc_conf/conf.pagelayout.inc.php");
require_once ("include/inc_conf/conf.template_default.inc.php");
require_once ("include/inc_lib/general.inc.php");
require_once ("include/inc_front/front.func.inc.php");
require_once ("include/inc_front/content.func.inc.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
phpwcms | open source web content management system
developed by Oliver Georgi (webverbund.de)
released under The GNU General Public License
visit project page: http://www.phpwcms.de
//-->
<html>
<head>
<title><?php echo $content["pagetitle"] ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php echo $block["htmlhead"] ?>
<script src="<?php echo ".".$phpwcms["templates"] ?>inc_js/frontend.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ".".$phpwcms["templates"]."inc_css/".$block["css"] ?>">
</head>
<body <?php echo $content["body"] ?>>
<?php
if (basename($PHP_SELF) == "index.php") {
echo $content["all"];
} else {
do_action();
}
save that to header.php
now put this in
footer.php:
Code: Select all
// show how long it needs to create content
// remove comments // to use it
// $timer->stop('main');
// echo spacer(5)."<br><span class=\"v09\"> created in ".($timer->get_current('main'))." sec</span>";
// echo "<br>".spacer(5);
?>
</body>
</html>
now, this should be the only thing in your index.php file:
Code: Select all
<?php
include "header.php";
include "footer.php";
?>
And in the custom script:
Code: Select all
<?php
include "header.php";
function do_action() {
<your custom script here>;
}
include "footer.php";
?>
Like I said, its no easy job, and it probably wont work, but at least give it a shot.