我已经用smarty编写了header.tpl和login.php文件。如果用户已登录,我希望显示注销文本。否则,如果用户未登录,则应显示login。in.below是login.php的代码
if(isset($_REQUEST['submit']))
{
$name=$_REQUEST['name'];
$pass=$_REQUEST['pass'];
$rs=mysql_query("select * from form where name='$name'")
Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file C:\xampp\htdocs\prestashop/cache/smarty/compile\06\99\53\0699537d98e8ffcfde91527d2e58a586c1a64d88.file.header.tpl.php' in C:\xampp\htdocs\prestashop\tools\smarty\sysplugins\smarty_internal_write_file
我试图使用名为name的变量通过smarty运行条件语句,但是在运行php文件时不会显示任何内容。我是smarty的新手。我所犯的错误是什么?
Test.php
<?php
require_once('./libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->assign('title','Title of the page');
$smarty->assign('hello','Text displayed
我无法让Smarty模板引擎在我的本地测试服务器上正常工作。我将它设置如下:
<?php
// put full path to Smarty.class.php
require('smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->testInstall();
$smarty->setTemplateDir('smarty/templates');
$smarty->setCompileDir('smarty/templates_c');
$smarty
在我更改了我的prestashop安装的域名后,我无法再连接到admin。我尝试了debug mod,然后我可以连接到admin,但在我的产品页面上出现错误:
(1/1) ContextErrorException
Notice: Undefined index: lng
in e50d7a72e070bd5681c93bfa420e5d7bf7ce90e8_2.file.product.tpl.php line 635
at Block_5636438495bf032887165a3_21987681->callBlock(object(SmartyDevTemplate))
in
由于后台的原因,我想增加一个产品。然而,当我去添加一个产品时,出现了这种情况。
"A server error occurred while loading the tabs: some tabs could not be loaded.
Please try again by refreshing the page.
If you are still encountering this problem, please check your server logs or contact your hosting provider for assistance."
让我感到不安的
我将构建一个在数据库中具有动态内容(属性如title、url等)的站点。我想每次查询所有的内容并分配变量是非常不相关的,所以我读过关于缓存的文章。
我用聪明的模板,系统。
include('libs/Smarty/Smarty.class.php');
$smarty = new Smarty;
$smarty->setCaching(true);
if (!$smarty->isCached('index.tpl')) {
//query here and assign..
$smarty->
我正在使用Smarty和我的php代码,我喜欢缓存一些网站页面,所以我使用了以下代码:
// TOP of script
ob_start(); // start the output buffer
$cachefile ="cache/cachefile.html";
// normal PHP script
$smarty->display('somefile.tpl.html') ;
$fp = fopen($cachefile, 'w'); // open the cache file for writing
fwrite($
我尝试用smarty用file_get_contents读取外部数据
然而,我得到了这个错误。
Fatal error: Smarty error: [in /opt/lampp/htdocs/blog/serendipity/templates/templates3/index.tpl line 107]: [plugin] (secure mode) modifier 'file_get_contents' is not allowed (Smarty_Compiler.class.php, line 1934) in /opt/lampp/htdocs/blog/sere
我为我的在线商店使用PrestaShop,桌面版运行良好,但我的AMP有问题,不是在主页上,而是当我试图访问一些产品时,如以下链接:
(1/1) SmartyException
0():Missing '$template' parameter
in smarty_internal_templatebase.php line 177
at Smarty_Internal_TemplateBase->_execute(null, null, 'layouts/layout-full-width.tpl', null, 0)
in smarty_inter
完整的错误消息是:
Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/cache/smarty/compile/9d/fc/13/wrt5df05326c094e8_21248361 <-- thrown in /var/www/html/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46
我已经清除了"/var/www/html/cache/smarty/compile/“目录,而"/var/www
遇到一些php设置的问题,但我自己解决不了,需要帮助。
Prestashop 1.6.0.14当allow_url_fopen为"On“时,无法加载管理界面,出现管理登录页面的白屏。错误报告不返回任何内容,仅返回空白白页。
脚本协议返回:
334","(Warning) Cannot modify header information - headers already sent by (output started at Admin_dir/index.php:34)"
但这些只是警告,后台必须正常工作。
当我禁用allow_url_fopen时,后台是可以工
我在web主机上安装了一个脚本,但当我想在本地主机上安装并运行它时,会收到以下错误:
setLogPath($config['debugger_log_dir']);
$debugger->setDebuggerTemplates($config['debugger_template_dir']);
//Start debugger timer $debugger->measureRunTime();
// Initialize db object for the queries $db = new Database($db_config);
Smarty 内置函数能够调用由{ function }标记定义的模板函数。现在,我需要调用一个模板函数,但是在插件函数中,因为我只知道插件中的函数名。
插件功能:
<?php
$smarty->registerPlugin('function', 'form_label', 'renderFormLabel');
function renderFormLabel($form, \Smarty_Internal_Template $template) {
// find out which function to cal