PHP的框架 [英] Frames with PHP

查看:97
本文介绍了PHP的框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在PHP中使用HTML框架吗?



我推测我可以这样做..

 <?php 
session_start();
require(auth.php);
require(do_html_header.php);
if($ _ SESSION ['SESS_admin'] == 0)
require(do_menu.php);
else
require(do_menu3.php);

do_html_header();
打印< h1>欢迎。 $ _SESSION [ SESS_FIRST_NAME]。 <!/ H1> 中;
do_menu();
?>
< / body>

< frameset rows =50%,50%>
< frame noresize =noresizesrc =limits.php/>
< frame noresize =noresizesrc =limits.php/>
< / frameset>

< / html>

我把它放在了每个地方,但它似乎没有显示出来。



Google迷惑了我。

感谢提前:D

解决方案

您可以使用带有HTML框架集的PHP,但不应该在框架集页面的< body> 元素中输出任何内容那么它应该是< noframes> ,而不是< body> )。内容进入您的< frame /> 元素包含的各个页面中。



无论如何,请勿使用框架。 PHP作为模板语言旨在帮助您通过包含来分离页面组件,首先渲染框架集是完全不必要的。


Can I use HTML Frames with PHP?

I presumed I can do this by..

<?php
session_start();
require("auth.php");
require("do_html_header.php");
if($_SESSION['SESS_admin'] == 0)
require("do_menu.php");
else
require("do_menu3.php");

do_html_header();
print"<h1>Welcome ". $_SESSION['SESS_FIRST_NAME']."!</h1>";
do_menu();
?>
</body>

<frameset rows="50%,50%">
<frame noresize="noresize" src="limits.php" />
<frame noresize="noresize" src="limits.php" />
</frameset>

</html>

I have put it everywhere but it seems not to show up..

Google just confused me.

Thanks in Advance :D

解决方案

You can use PHP with HTML framesets, but you shouldn't be outputting anything in a <body> element of a frameset page (even then it should be <noframes>, not <body>). Content goes within the individual pages contained by your <frame /> elements.

Anyway, don't use frames. PHP as a templating language is meant to help you separate components of your pages by way of includes, rendering framesets completely unnecessary in the first place.

这篇关于PHP的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆