:::

9-4 config.php

<<?php

//資料庫位址
define('_MYSQL_SERVER', "localhost");

//資料庫帳號
define('_MYSQL_NAME', "資料庫帳號");

//資料庫密碼
define('_MYSQL_PASSWD', "資料庫密碼");

//資料表庫名稱
define('_MYSQL_DBNAME', "資料表庫名稱");

error_reporting(-1);

/*-----------------------------------------------------*/

// 啟用 session
session_start();

$url=urlencode("http://".$_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI']) ;

if(isset($_GET['g2p'])){
  $g2p=$_SESSION['g2p']=intval($_GET['g2p']);
}else{
  $g2p=isset($_SESSION['g2p'])?intval($_SESSION['g2p']):"";
}


if(isset($_SESSION['uid']) and !empty($_SESSION['uid'])){
  $login="
  <div class='alert alert-info'>
    <a href='index.php?op=logout' class='btn btn-danger btn-xs pull-right'>登出</a>
    {$_SESSION['uname']}您好!
  </div>
  ";
}else{
  $login="
  <div class='row' style='margin:10px;'>
    <form action='index.php' method='post' class='form-horizontal' role='form'>
      <div class='form-group'>
        <label class='col-md-4 control-label'>帳號</label>
        <div class='col-md-8'><input type='text' name='uname' class='form-control'></div>
      </div>
      <div class='form-group'>
        <label class='col-md-4 control-label'>密碼</label>
        <div class='col-md-8'><input type='password' name='passwd' class='form-control'></div>
      </div>
      <input type='hidden' name='op' value='login'>
      <button type='submit' class='btn btn-success pull-right'>登入</button>
    </form>
  </div>
  ";
}
?>

 


:::

搜尋

QR Code 區塊

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

書籍目錄

展開 | 闔起

線上使用者

354人線上 (145人在瀏覽線上書籍)

會員: 0

訪客: 354

更多…