<?php
include_once('Smarty_config.php');if (!empty($_COOKIE['user_name'])){
header("location: index.php");
}
$smarty->display("index_bc.htm");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hotel</title>
</head>
<frameset rows="120,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.htm" name="topFrame" scrolling="NO" noresize />
<frameset rows="*" cols="190,*" framespacing="0" frameborder="NO" border="0">
<frame src="index_left.htm" name="leftFrame" scrolling="NO" noresize/>
<frame src="index_content.htm" name="mainFrame" />
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>
include_once('Smarty_config.php');if (!empty($_COOKIE['user_name'])){
header("location: index.php");
}
$smarty->display("index_bc.htm");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hotel</title>
</head>
<frameset rows="120,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.htm" name="topFrame" scrolling="NO" noresize />
<frameset rows="*" cols="190,*" framespacing="0" frameborder="NO" border="0">
<frame src="index_left.htm" name="leftFrame" scrolling="NO" noresize/>
<frame src="index_content.htm" name="mainFrame" />
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>
//php 页面
define('ROOT_PATH',str_replace('\\','/',str_replace('test1.php','',__FILE__)));
include(ROOT_PATH.'smarty/libs/Smarty.class.php');
$s=new Smarty();$s->template_dir = ROOT_PATH.'template';
$s->compile_dir = ROOT_PATH.'compile';
$s->cache_dir = ROOT_PATH.'cache';
$s->config_dir = ROOT_PATH.'config';$s->debugging = false;
$s->caching = true;$s->left_delimiter = '{';
$s->right_delimiter = '}';
if (!empty($_COOKIE['user_name'])){
header("location: index.php");
}
$smarty->display("index_bc.htm");//htm页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hotel</title>
</head>
<frameset rows="120,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.htm" name="topFrame" scrolling="NO" noresize />
<frameset rows="*" cols="190,*" framespacing="0" frameborder="NO" border="0">
<frame src="index_left.htm" name="leftFrame" scrolling="NO" noresize/>
<frame src="index_content.htm" name="mainFrame" />
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>
index_content.php
<?php
include_once('Smarty_config.php');
$smarty->display("index_content.htm");
?>
$tpl = new Smarty();
$tpl->template_dir ="index.html"//模板文件
$tpl->compile_dir = "templates_c/";//解析成PHP文件,读写权限要有
/*可使用
$tpl->config_dir = "configs/";//配置
$tpl->cache_dir = "cache/";//静态文件缓存,读写权限要有
$tpl->caching =true;//开启缓存
$tpl->cache_lifetime =120; //缓存时间/秒*/
$tpl->display($index);
index.html<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hotel</title>
</head>
<frameset rows="120,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.htm" name="topFrame" scrolling="NO" noresize />
<frameset rows="*" cols="190,*" framespacing="0" frameborder="NO" border="0">
<frame src="index_left.htm" name="leftFrame" scrolling="NO" noresize/>
<frame src="index_content.htm" name="mainFrame" />
</frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>看看官方http://www.smarty.net/quick_start.php
问题是我现在把他分成一个htm页与php页了,分成之后直接输入index_bc没有登陆也直接进入这页
header("location: index.php");
} 这个是不是在调用他的php面里面
header("location: index.php");
}
要这样