我的框架(3)

来源:互联网 发布:淘宝页头招牌怎么修改 编辑:程序博客网 时间:2024/05/21 17:19

生成列表:

<?
include "dsn.php";
if(!isset($_POST["isshow"]))exit("select");
$fieldname = $_POST["fieldname"];
$displayname = $_POST["displayname"];
$isshow = $_POST["isshow"];
$tablename = $_POST["tablename"];
$ref = $_SERVER['HTTP_REFERER'];
$filename = preg_replace("/^{$tablepre}/i",'',$tablename);

$clohead = array();
$fields = array();
foreach($isshow as $key=>$val)
{
 $clohead[] = $displayname[$key];
 $fields[] = $key;
}

$filename = "./template/".$filename."_list_tpl.php";
ob_start();

include "global_tpl/list_tpl.php";

$content = ob_get_contents();

ob_end_clean();

$len = file_put_contents($filename,$content);

header("location:{$ref}");
?>