Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用PHP将html加载到<;部门>;单击按钮时_Php_Xhtml - Fatal编程技术网

如何使用PHP将html加载到<;部门>;单击按钮时

如何使用PHP将html加载到<;部门>;单击按钮时,php,xhtml,Php,Xhtml,我目前有一个网站,它使用iframe将html加载到页面中心,同时保持标题和菜单的静态 有没有一种方法可以用PHP实现这一点,或者我应该在网站的每个页面上重复使用标题代码?.htaccess RewriteEngine on RewriteRule ^(.*html)$ index.php?page=$1 [QSA,L] index.php <? if (empty($_GET['page'])) $_GET['page']="index.html"; $PAGE = basename

我目前有一个网站,它使用iframe将html加载到页面中心,同时保持标题和菜单的静态

有没有一种方法可以用PHP实现这一点,或者我应该在网站的每个页面上重复使用标题代码?

.htaccess

RewriteEngine on
RewriteRule  ^(.*html)$ index.php?page=$1 [QSA,L]
index.php

<?
if (empty($_GET['page'])) $_GET['page']="index.html";
$PAGE = basename($_GET['page']);
if (!is_readable($PAGE)) {
  header("HTTP/1.0 404 Not Found");
  $PAGE = "404.html";
}
include("template.html");
?>

嘿,谢谢你的回复,你能解释一下index.php中的代码是做什么的吗?它只是在网站的每个页面上重复使用标题代码
<html>
<table>
 <tr>
  <td width=200>
    <a href = "/">Main</a><br>
    <a href = "photo.html">Photos</a><br>
  </td>
  <td width=600>
<? include $PAGE ?>  
  </td>
 </tr>
<table>
</html> 
Sorry, page not found