You are here: Re: can you redirect every existing html page through a php function? « PHP Programming Language « IT news, forums, messages
Re: can you redirect every existing html page through a php function?

Posted by The Numerator on 03/29/06 06:50

Use this code:

<html>
<head>
<title>CWO</title>
<base href="http://www.christwarriors.net/stuff/index.html">
</head>
<body>
<?php

$p = $_GET['p']; // This sets the variable

if ($_GET['title'] == "") // If its only dopage.php,
{
include "index.html"; // show index.html (problem is that all the links
are relative to the php file not the html)
}

elseif ($_GET['p'] == "mysite.html") // If the URL is
dopage.php?p=mysite.html,
{
include "mysite.html"; // show mysite.html
}

else // if its none of the above
{
include "invalid.html"; // show the page invalid.html
}

?>
</body>
</html>

the only problem is that the links are relative only to the php...but
you can easily work around that

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация