:::

2-1 index.php

<?php
  //設定新聞發布密碼
  $passwd='12345';

  //過濾外面傳來的變數
  $op=isset($_POST['op'])?$_POST['op']:"";
  $password=isset($_POST['password'])?$_POST['password']:"";
  $news_title=isset($_POST['news_title'])?$_POST['news_title']:"";
  $news_content=isset($_POST['news_content'])?$_POST['news_content']:"";

  //接收使用者輸入密碼,失敗轉回發布頁
  if($op=="save" && (empty($password) || $password!=$passwd)){
    setcookie('news_title',$news_title);
    setcookie('news_content',$news_content);
    header("location:post.php?op=passwd_error");
  }else{
    // nl2br()將換行符號轉換為<br>標籤
    $news_content=nl2br($news_content);
  }

  //載入小強樣板引擎
  include_once('tbs_class.php');
  $TBS =new clsTinyButStrong ;
  //套用到 index_tpl.html 樣板
  $TBS->LoadTemplate('index_tpl.html',False) ;
  $TBS->Show() ;
?>

 


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.cp27.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1024%26tbsn%3D34

書籍目錄

展開 | 闔起

線上使用者

346人線上 (147人在瀏覽線上書籍)

會員: 0

訪客: 346

更多…