
Originally Posted by
ralph.m
Hey greedyman, I don't know PHP, just to warn you (though I like to tinker with the basics), but here's perhaps a simple way to do what you want:
PHP Code:
<?php $page = basename($_SERVER['PHP_SELF']);
if ($page == "redirect.php") {
include $_SERVER["DOCUMENT_ROOT"] . "/folder/file.php";
};
?>
This is just me tinkering. I'm sure someone has a better answer, from which I'll learn too.

Hi! Thank a lot ralph.m. I'll try it now. But my page have four columns, three columns in these is change when I direct to any page. I don't want copy code from this file to that file and then use the code of your. Example:
index.php
PHP Code:
<div id="indexLeftColumn">
<div id="navigation">
// if 'index.php' then include ('abc.php');
</div><!-- end # -->
</div><!-- end #indexLeftColumn -->
<div id="indexRightColumn">
<div id="innner">
// if 'category.php' then include('def.php');
</div><!-- #inner -->
</div><!-- end #indexRightColumn -->
cart.php
PHP Code:
<div id="indexLeftColumn">
<div id="navigation">
// if 'cart.php' then include ('c.php');
</div><!-- end # -->
</div><!-- end #indexLeftColumn -->
<div id="indexRightColumn">
<div id="innner">
// if 'cake.php' then include('d.php');
</div><!-- #inner -->
</div><!-- end #indexRightColumn -->
index.php's code and cart.php's code are similar. How can I arrange the main page and include page to more easy?
Bookmarks