open inside current page
Posted: Wed Jan 07, 2004 7:49 pm
is there a PHP code that allows me to open a page inside a site that uses include tags and then the code for the main page and when you click a link it changes ???
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
if(!isset($_GET["page"]))
{
$page = "news";
}
else
{
$page = $_GET["page"];
}
?>
<html>
<head>
</head>
<body>
<?php include($page.".php") ?>
<hr />
<a href="?page=news">News Page</a><br />
<a href="?page=biog">Biog Page</a>
</body>
</html>Code: Select all
else
{
$page = $_GET["page"];
}Code: Select all
else
{
$page = basename($_GET["page"]);
}