Title1

Title2

Title3

10. 製做「登入後台」畫面

一、登入後台程式

  1. 程式流程
  2. 全局變數
  3. 使用函數

二、登入畫面樣板

  1. 利用後台的 login.html
    /templates/admin/pages/login.html
  2. 把它存在 default/tpl/creative_login.html

三、smarty條件判斷

<{if 判斷式"}>
   成立    
<{else}>
   不成立
<{/if}>

四、表單

五、頁面轉向

  1. HTML
    <meta http-equiv="refresh" content="0;url=smarty_02/" />

     

  2. PHP
    header("location:admin/index.php");

    這種寫法有個先決的條件,就是前面不能出現任何的輸出.否則會錯誤

  3. JS
    <script language="JavaScript">
        window.location.replace("https://www.ugm.com.tw");
    </script>

     

六、登入畫面

    <div style='position:fixed;top:1px;left:1px;z-index:10000'>
      <{if $smarty.session.admin}>
        <a href="<{$smarty.const.WEB_URL}>/admin/index.php">&nbsp;&nbsp;</a>
      <{else}>
        <a href="<{$smarty.const.WEB_URL}>/admin.php">&nbsp;&nbsp;</a>
      <{/if}>
    </div >