Steph
Sun 23rd May '04, 4:17am
Hi all,
I thought while our graphic designer works on the template for my forum, Id work on other sections of my site. I'm no pro at programming. I know some basic php and qbasic and not including html/css, that's pretty much it.
Anyways, I was trying to use the code provided on this site to accomplish dynamic inclusion: http://www.regretless.com/dodo/newworld/ (d inclusion 2) where you have something like: http://mysite.com/test.php?mypage and whenever I try this code it goes to the default variable listed as main.php, instead of the file i'm trying to call (in my above scenarion - mypage.php). If there is a better way to do this than presented in this tutorial or if someone can enlighten me on what I'm doing wrong. It would be greatly appreciated.
the test.php page looks like this:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> test </title>
</head>
<body>
<?php
if($z) {
// make sure it's a file in this particular directory
// $_server['query_string'] gives you everything after
// the question mark
$z = basename($_server['query_string']);
// make php extension for it
$z .= ".php";
include($z);
} else {
include("main.php");
}
?>
</body>
</html>
I thought while our graphic designer works on the template for my forum, Id work on other sections of my site. I'm no pro at programming. I know some basic php and qbasic and not including html/css, that's pretty much it.
Anyways, I was trying to use the code provided on this site to accomplish dynamic inclusion: http://www.regretless.com/dodo/newworld/ (d inclusion 2) where you have something like: http://mysite.com/test.php?mypage and whenever I try this code it goes to the default variable listed as main.php, instead of the file i'm trying to call (in my above scenarion - mypage.php). If there is a better way to do this than presented in this tutorial or if someone can enlighten me on what I'm doing wrong. It would be greatly appreciated.
the test.php page looks like this:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title> test </title>
</head>
<body>
<?php
if($z) {
// make sure it's a file in this particular directory
// $_server['query_string'] gives you everything after
// the question mark
$z = basename($_server['query_string']);
// make php extension for it
$z .= ".php";
include($z);
} else {
include("main.php");
}
?>
</body>
</html>