smarty静态实验表明,网络上是错的~呵呵

yipeiwu_com6年前PHP代码库

复制代码 代码如下:
<? 
 require_once("Smarty/libs/Smarty.class.php"); 
 $smarty = new smarty(); 
 $smarty->templates_dir="templates"; 
 $smarty->templates_c_dir="templates_c"; 
 $smarty->left_delimiter="<{"; 
 $smarty->right_delimiter="}>"; 
 $smarty->assign("title","你成功了"); 
 $smarty->display("test.html"); 
 $content=$smarty->fetch("test.html"); 
 $fp=fopen("ok.html","w"); 
 fwrite($fp,$content); 
 fclose($fp); 
?>

相关文章

详解php命令注入攻击

详解php命令注入攻击

这次实验内容为了解php命令注入攻击的过程,掌握思路。 命令注入攻击 命令注入攻击(Command Injection),是指黑客通过利用HTML代码输入机制缺陷(例如缺乏有效验证限制的...

微信公众平台DEMO(PHP)

本人在SAE环境下搭建了CI框架(其实这个小东西用不着用框架的),直接把代码写在了控制器里面 <?php if ( ! defined('BASEPATH')) exi...

8个PHP数组面试题

网上找的PHP数组题,准备自己做一遍并且记录下来。 1.写函数创建长度为10的数组,数组中的元素为递增的奇数,首项为1. 复制代码 代码如下: <?php  &n...

PHP常用技巧汇总

本文为大家分享了多个php常用技巧,供大家参考,具体内容如下 1、PHP文件读取函式 //文件读取函式 function PHP_Read($file_name) { $fd=fo...

PHP无刷新上传文件实现代码

index.html 复制代码 代码如下: <html> <head> <title>无刷新上传文件</title> <meta C...