gpt4 book ai didi

php - Smarty,页面/部分页面没有缓存

转载 作者:行者123 更新时间:2023-11-29 09:04:41 25 4
gpt4 key购买 nike

我正在使用 VLDPersonals 脚本,它使用 smarty 作为模板系统,没有问题,但是,我需要添加一个通知页面,用户必须单击“我理解”按钮,但是没有问题,smarty 决定缓存/编译页面,因此当下一个用户到来时,他们将无法单击该按钮,因为 php POST 句柄不会触发...当前代码是

<div class="entry">
<?php
if(isset($_POST['understand'])) {
$conn = mysql_connect('localhost', 'user', 'password');
mysql_select_db("table", $conn);
mysql_query("sql..");

}
?>
<p>Notice text</p>
<form action="" method="post">
<input type="submit" value="I Understand!" name="understand" />
</form>
</div>

我尝试添加 {nocache} 标签,但没有成功,尝试通过我发现的一些指南定义 nocache 标签,没有成功,尝试刷新缓存,没有成功.. smarty 对象被分配给 $TEMPLATE,任何人有帮助?让我很头疼!

最佳答案

vldPersonals 不使用 Smarty,它使用自己的自定义编码模板引擎。尽管可以在 .tpl 文件中使用纯 PHP 代码,但不建议这样做。我建议在相应的 lib 文件中使用 php 语句(例如 account/home/页面的 lib.account_home.php )。查看 lib.member_pictures.php 和 member_pictures_view.tpl 中的成人警告代码示例

关于php - Smarty,页面/部分页面没有缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7407486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com