PHP 框架

发布于 2024-10-10 02:23:17 字数 592 浏览 0 评论 0原文

我可以在 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();
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>

我把它放在各处,但它似乎没有出现..

谷歌只是让我困惑。

提前致谢:D

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如果没有 2024-10-17 02:23:17

您可以将 PHP 与 HTML 框架集结合使用,但不应在框架集页面的 元素中输出任何内容(即使如此,它也应该是 ,而不是 <code></code>)。内容位于 <code></code> 元素包含的各个页面中。

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

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.

享受孤独 2024-10-17 02:23:17

是的,您可以使用框架。但您必须输出框架集文件中的实际内容,在您的例子中为 limits.php。这里要注意一些事情:

  • 在框架集文件中启动会话是可以的。
  • 但您还必须在 limit.php 框架内容文件中使用 session_start() 。
  • 同样,HTTP 验证应该在所有帧文件中执行。
  • 不要假设人们无法直接访问 do_menu3.php。

我之前使用框架来实现 NortonCommand-克隆在网络上,它比 CSS 排列 div 更有意义。然而,使用框架处理 jQuery 更加麻烦。对于 PHP 来说,就像将每个框架脚本视为单独的入口脚本一样简单。

Yes, you can use frames. But you'll have to output the actual content in the frameset files, in your case limits.php. Beware of a few things here:

  • Starting the session in the frameset file is ok.
  • But you'll also have to session_start() in the limits.php frame content file.
  • Likewise the HTTP authentication should be performed in all frame files.
  • Do not assume that people cannot access do_menu3.php directly.

I've previously used frames for implementing a NortonCommand-clone for the web, where it's more senseful than CSS-arranging divs. However, handling jQuery is more cumbersome with frames. In regards to PHP it's as simple as treating every frame script as individual entry script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文