Php Smarty变量声明错误
我有PHP代码:Php Smarty变量声明错误,php,smarty,Php,Smarty,我有PHP代码: $uid = $xUS['id']; // Current user id $uname = $xUS['x_username']; // Current user name $ulink = ''; // Current user profile URL (leave blank for none) $upic = $xUS['config_forum_avator_head']; // Current user $ismo
$uid = $xUS['id']; // Current user id
$uname = $xUS['x_username']; // Current user name
$ulink = ''; // Current user profile URL (leave blank for none)
$upic = $xUS['config_forum_avator_head']; // Current user
$ismod = 0; // Is current user a moderator?
$sig = md5($uid . $uname . $ismod . 's79tvi40k95bs6mw');
$ssoParams = '&uid=' . $uid . "&uname=" .
urlencode($uname) . "&ulink=" . urlencode($ulink) . "&upic=" . urlencode($upic)
. "&ismod=" . $ismod . "&sig=" . $sig;</i>
我的Smarty模板文件:
在这种情况下,{$ssoParams}变量返回空值。为什么?请提供帮助。阅读Smarty文档,例如: 您需要分配一个变量,如:
$smarty = new Smarty();
$smarty->分配'ssoParams',$ssoParams;//分配Smarty变量、PHP变量;
$smarty->显示“template_file.tpl”
当然,您需要包括smarty文件、定义模板等
有关基本工作示例,请参见示例2.9。在这里:
奇怪。检查您的路径是否正确。比如这里:需要一个合作伙伴Smarty.class.php';或者使用:require_once'path/to/smarty/smarty.class.php';然后,对于template_dir、compile_dir等,使用或取消注释这一行,这样您应该会收到调试窗口$smarty->调试=true;还要确保调用了正确的模板文件。在这一行中,使用模板文件的名称:$smarty->display'template_file.tpl';同时尝试CHMOD templates\u c目录以获得写入权限。755777之类的。