Smarty file display in php

墨辰丷
Release: 2023-03-25 19:50:02
Original
1723 people have browsed it

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

    Document 
账号
密码
文件
Copy after login


Add jump to the add page

say($_POST,$_FILES,'img',"images/",'image'); //1参数为上传的文本信息,2参数为上传图片信息, 3 参数为图片的name名,4参数为移动文件目录,5参 数为添加到的数据表。 if ($res) {echo "";//成功则自动跳转查询页面}else{echo "";//失败则自动跳转form表单} ?>
Copy after login

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"); //指向的页面 ?>
Copy after login

Display and search page

    展示 
{section loop=$list name=l} {if {$list[l].ll} eq 1} {else} {/if} {/section}
id name pwd img
{$list[l].id} {$list[l].aa} {$list[l].bb} 上架下架删除
首页 上一页 下一页 为页
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!