zoukankan      html  css  js  c++  java
  • php与smarty结合应对表单get的一个小例子

    关键词:smarty, php, get

    目的: 给一个简易网站(无数据库)设计简易搜索功能,搜索原理,由于不是基于数据库的,只能采用关键词比对的方法,比如,用户在搜索框中输入某个词,点击搜索按钮,然后程序获取该关键词,与数据库中事先设置好的关键词比对,如果是,则进行下一步的处理,比如跳转,比如展示。

    index.php

     

    search.php 处理页面

     

    search.tpl 模板

     

    运行,可以,但是很不妥,每次这样添加关键词太麻烦,要改很多地方,于是重写search.tpl 模板

     

    运行,报错。纠结中...

    各种错误,那个烦.....

    最后研究发现 smarty 自带了 从get 获取 值的方法,这样就不必套用php 来搞定了!紧急更新,最终成功!

     

    当然别忘了配置调用它的php文件:

     

    生活还真是有意思!~

  • 相关阅读:
    在没有备份的情况下重新创建丢失的数据文件 (Doc ID 1149946.1)
    How to recover a skipped tablespace after an incomplete recovery? (Doc ID 1561645.1)
    RMAN DUPLICATE DATABASE with SET NEWNAME failed: RMAN-05501 RMAN-05517 (Doc ID 387093.1)
    Rman Enhancements(增强) In Oracle 11g. (Doc ID 1115423.1)
    Resolving RMAN-06023 or RMAN-06025 (Doc ID 2038119.1)
    Checklist for an RMAN Restore (Doc ID 1554636.1)
    Recover With Until Time fails With RMAN-20207 When Time Is Before Last RESETLOGS (Doc ID 159405.1)
    ODA: After Apply ODA 12.2.1.2.0 Patch, Unable to Create TableSpace Due to [ORA-15001: diskgroup "DATA" does not exist or is not mounted | ORA-15040: diskgroup is incomplete] (Doc ID 2375553.1)
    How to restore and recover a database from an RMAN backup. (Doc ID 881395.1)
    How To Restore Rman Backups On A Different Node When The Directory Structures Are Different (Doc ID 419137.1)
  • 原文地址:https://www.cnblogs.com/lechie/p/2383239.html
Copyright © 2011-2022 走看看