| 14 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
#指派命名空間
|
|
|
4 |
namespace qbpwcf{
|
|
|
5 |
|
|
|
6 |
#匯入外部套件
|
|
|
7 |
include("../allInOne.php");
|
|
|
8 |
|
|
|
9 |
#提示要測試的案例
|
|
|
10 |
echo "<hr>form::responseMutiInputDataSecurityEnhance<br>";
|
|
|
11 |
|
|
|
12 |
/* 目的端不需要
|
|
|
13 |
#涵式說明:
|
|
|
14 |
#一個簡單的按鈕,按了可以到指定的頁面。同時也可以傳送多個隱藏的變數
|
|
|
15 |
#回傳的結果
|
|
|
16 |
#$result,語法內容
|
|
|
17 |
#必填的參數:
|
|
|
18 |
$conf["actionPage"]=$_SERVER["PHP_SELF"];#按鈕按了之後要到哪個地方?若爲 $_SERVER["PHP_SELF"],則爲回到目前頁面。
|
|
|
19 |
$conf["buttonDisplayValue"]="傳送變數";#按鈕上要顯示的文字
|
|
|
20 |
#可以省略的參數:
|
|
|
21 |
#$conf["buttonStyleName"]="";#按鈕的css樣式應該爲何,若省略的話預設會採用 __simpleButtonLinkDefaultButtonCssStyle 的樣式
|
|
|
22 |
#其屬性爲 "width","height","font-size","text-align"
|
|
|
23 |
#其屬性值爲 "300" , "50" , "30" , "center"
|
|
|
24 |
#備註:
|
|
|
25 |
# __simpleButtonLinkDefaultButtonCssStyle,爲預設的按鈕css樣式,請勿使用相同類別名稱的css樣式,以免衝突。
|
|
|
26 |
$conf["hiddenVarName"]=array("a","b","c");#要傳送的隱藏變數名稱,與 $conf["hiddenVarContent"] 相對應。
|
|
|
27 |
$conf["hiddenVarContent"]=array("A","B","C");#要傳誦的隱藏變數內容,與 $conf["hiddenVarName"] 相對應。
|
|
|
28 |
#$conf["tableStart"]="true";#爲是否要表格開始,"true"表示"是"。
|
|
|
29 |
#$conf["tableClass"]="__withoutBorder";#爲表格要採用的css樣式名稱,"__withoutBorder"代表沒有框線的預設樣式;"__withBorder"代表有框線的預設樣式
|
|
|
30 |
#$conf["trStart"]="true";#爲是否要以<tr>開頭,"true"表示"是"。也可以看作新的一列開始。
|
|
|
31 |
#$conf["trClass"]="__withoutBorder";#列開始的css樣式,"__withoutBorder"代表沒有框線的預設樣式;"__withBorder"代表有框線的預設樣式
|
|
|
32 |
#$conf["tdStart"]="true";#爲是否要以<td>開頭,"true"表示"是"。也可以看成列裏面的元素開始
|
|
|
33 |
#$conf["tdClass"]="__withoutBorder";#行開始的css樣式,"__withoutBorder"代表沒有框線的預設樣式;"__withBorder"代表有框線的預設樣式
|
|
|
34 |
#$conf["tdEnd"]="true";#爲是否要以</td>結尾,"true"表示"是"。也可以看成列裏面的元素結束
|
|
|
35 |
#$conf["trEnd"]="true";#爲是否要以</tr>結尾,"true"表示"是"。也可以看作該列結束。
|
|
|
36 |
#$conf["displayTarget"]="";#頁面的呈現方法,可以是開新視窗(_blank)、在目前頁面、頁框裏面(_self)、在父頁面(_parent)、最上層頁面(_top),預設為"_top"。
|
|
|
37 |
#$conf["tableEnd"]="true";#爲是否要表格結束,"true"表示"是"。
|
|
|
38 |
echo form::sendHugeDataButton($conf);
|
|
|
39 |
unset($conf);
|
|
|
40 |
*/
|
|
|
41 |
|
|
|
42 |
/* 目的端不需要
|
|
|
43 |
#涵式說明:
|
|
|
44 |
#可以處理多個透過GET、POST而來的資訊,儲存成變數,同時限定傳送的方法、來源,來增加安全性。
|
|
|
45 |
#回傳的結果:
|
|
|
46 |
#$result["status"],執行是否成功,"true"代表執行成功;"false"代表執行失敗。
|
|
|
47 |
#$result["error"],錯誤訊息。
|
|
|
48 |
#$result["inputDataContent"],所接收的參數陣列。
|
|
|
49 |
#$result["inputDataContent"]["變數名稱"],所接收變數的內容
|
|
|
50 |
#$result["inputDataCount"],總共接收到幾個元素。
|
|
|
51 |
#必填的參數:
|
|
|
52 |
$conf["method"]="post";#傳送過來的資料是用"post/POST"還是"get/GET"?
|
|
|
53 |
#可省略的參數:
|
|
|
54 |
#$conf["allowGet"]="false";#是否要允許 get 傳值,"true",代表允許;"false" ,代表不允許,預設爲不允許。
|
|
|
55 |
$conf["limitPrePage"]="formT.php";#是否要限定前一頁的網址為何,才能接收內容,不符合則轉址。
|
|
|
56 |
#$conf["transferLocation"]="";#遇到get傳值的時候要轉址到的頁面,預設爲資安素養網"https:#isafe.moe.edu.tw/"
|
|
|
57 |
$conf["ignore"]=array("B");#如果要接收的變數名稱與該陣列其一元素一樣,則不放進要回傳的變數裏面。
|
|
|
58 |
#$conf["correctCharacter"]="false";#如果爲"false",則不處理可能導致網頁出問題的字串,預設爲要進行處理。
|
|
|
59 |
#參考資料來源:
|
|
|
60 |
#foreach 的用法 -> http:#php.net/manual/en/control-structures.foreach.php
|
|
|
61 |
var_dump(form::responseMutiInputDataSecurityEnhance($conf));
|
|
|
62 |
unset($conf);
|
|
|
63 |
*/
|
|
|
64 |
|
|
|
65 |
var_dump($_SESSION);
|
|
|
66 |
|
|
|
67 |
#檢視session變數的內容
|
|
|
68 |
#函式說明:
|
|
|
69 |
#取得session變數裡面的數值,然後卸除該session變數
|
|
|
70 |
#回傳的結果:
|
|
|
71 |
#$result,取得的變數內容
|
|
|
72 |
#必填的參數:
|
|
|
73 |
$conf["sessionVarName"]=$_SESSION["fromFormTtoFormT3"];#要取得內容的session變數
|
|
|
74 |
#可省略的參數:
|
|
|
75 |
$conf["unsetSessionVar"]="true";#"true"代表要卸除session變數
|
|
|
76 |
#參考資料:
|
|
|
77 |
#http://stackoverflow.com/questions/8971261/php-5-4-call-time-pass-by-reference-easy-fix-available
|
|
|
78 |
#可變變數->http://emn178.pixnet.net/blog/post/80119035-php%E6%95%99%E5%AD%B8---%E8%AE%8A%E6%95%B8%28variables%29
|
|
|
79 |
#卸除參考的原始變數->http://stackoverflow.com/questions/6654538/php-function-to-unset-variables-passed-by-reference
|
|
|
80 |
var_dump(session::getSessionValue($conf));
|
|
|
81 |
unset($conf);
|
|
|
82 |
|
|
|
83 |
}//namespace end
|
|
|
84 |
|
|
|
85 |
?>
|