This article mainly introduces the file display of smarty in php. Interested friends can refer to it. I hope it will be helpful to everyone.
First make a simple form
Add jump to the add page
say($_POST,$_FILES,'img',"images/",'image'); //1参数为上传的文本信息,2参数为上传图片信息, 3 参数为图片的name名,4参数为移动文件目录,5参 数为添加到的数据表。 if ($res) {echo "";//成功则自动跳转查询页面}else{echo "";//失败则自动跳转form表单} ?>
Query page
say('bb','2',$aa); //三个值分别为表名 分页每页的个数 和查询的值 $shang=$p7->shang; //获取上一页的变量 $xia=$p7->xia; //获取下一页的变量 $wei=$p7->wei; //获取尾wei页的变量 include ("libs/Smarty.class.php"); //引入Smarty文件 $ok = new Smarty; $ok->assign("aa",$aa); $ok->assign("shang",$shang); $ok->assign("xia",$xia); $ok->assign("wei",$wei); $ok->assign("list",$data); //指向并赋值 $ok->display("show.php"); //指向的页面 ?>
Display and search page
Related recommendations:
More complete notes on Smarty in PHP
Configuration file data and retained data of smarty template engine
Smarty built-in in PHP Detailed explanation of function include
The above is the detailed content of Smarty file display in php. For more information, please follow other related articles on the PHP Chinese website!