Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[981]PHP入門+XOOPS模組設計」目錄
MarkDown
16. 偏好設定與所見即所得
1. 相見歡
1-1 index.php 內容
2. PHP與表單
2-1 contact/index.php
3. 讓程式聰明又乾淨
3-1 index.php 原始語法
4. 寫入資料庫
4-1 index.php
5. 撈取資料庫資料
5-1 index.php
6. 把資料庫資料作成列表
6-1 index.php
7. 讓程式套用佈景
7-1 index.php
8. 加入修改刪除功能
8-1 index.php
9. 上傳檔案並做縮圖
9-1 index.php
10. 安裝XOOPS
10-1 index.php
11. XOOPS模組架構
11-1 index.php
11-2 index2.php
12. $xoopsUser應用
12-1 index.php
13. 分頁與搜尋
13-1 include/search.php
13-2 index.php
14. 樣板及評論
14-1 view.php
14-2 index.php
14-3 comment_new.php
15. 製作XOOPS區塊
15-1 blocks/new_contact.php
16. 偏好設定與所見即所得
16-1 view.php
17. 多國語系與圖形驗證
17-1 index.php
17-2 [語系]language/tchinese_utf8/modinfo.php
17-3 [語系]xoops_version.php
17-4 [語系]admin/menu.php
17-5 [sprintf示範]index.php
17-6 [sprintf示範]main.php
18. 模組自動功能
18-1 include/onUninstall.php
18-2 include/onUpdate.php
17. 多國語系與圖形驗證
\[981\]PHP入門+XOOPS模組設計 ====================== <?php include\_once "../../mainfile.php"; $xoopsOption\['template\_main'\] = "view\_tpl.html"; define("\_DIR",XOOPS\_ROOT\_PATH."/uploads/tad\_contact"); $sn=(empty($\_REQUEST\['sn'\]))?"0":intval($\_REQUEST\['sn'\]); $main=show\_data($sn); include\_once XOOPS\_ROOT\_PATH."/header.php"; //echo $main; $xoopsTpl->assign("content" , $main); include\_once XOOPS\_ROOT\_PATH.'/include/comment\_view.php'; include\_once XOOPS\_ROOT\_PATH.'/footer.php'; //顯示結果 function show\_data($sn=""){ global $xoopsDB,$xoopsUser; $tbl=$xoopsDB->prefix('contact'); $sql="select \* from `$tbl` where `sn`='$sn'"; $result=$xoopsDB->query($sql) or die(mysql\_error()); $data=mysql\_fetch\_array($result); $sex=($data\['sex'\]=="m")?"先生":"女士"; //$\_POST\['note'\]=stripslashes($\_POST\['note'\]); if($xoopsUser){ $main= "<table border=1 style='width:auto;'> <tr><th>姓名</th><td>{$data\['name'\]}</td></tr> <tr><th>性別</th><td>{$sex}</td></tr> <tr><th>Email</th><td>{$data\['email'\]}</td></tr> <tr><th>電話</th><td>{$data\['tel'\]}</td></tr> <tr><th>手機</th><td>{$data\['mtel'\]}</td></tr> <tr><th>地址</th><td> {$data\['zip'\]}{$data\['city'\]}{$data\['town'\]}{$data\['address'\]} </td></tr> <tr><th>服務單位</th><td>{$data\['company'\]}</td></tr> <tr><th>職稱</th><td>{$data\['job'\]}</td></tr> <tr><th>大頭照</th><td></td></tr> <tr><th>其他說明</th><td>{$data\['note'\]}</td></tr> </table>"; }else{ $cols=explode(";",$data\['show\_data'\]); $main= "<table border=1 style='width:auto;'> <tr><th>姓名</th><td>{$data\['name'\]}</td></tr>";
$main.=
(in\_array("Email",$cols))
?"<tr><th>Email</th><td>{$data\['email'\]}</td></tr>":""; $main.=(in\_array("性別",$cols))?"<tr><th>性別</th><td>{$sex}</td></tr>":""; $main.=(in\_array("電話",$cols))?"<tr><th>電話</th><td>{$data\['tel'\]}</td></tr>":""; $main.=(in\_array("手機",$cols))?"<tr><th>手機</th><td>{$data\['mtel'\]}</td></tr>":""; $main.=(in\_array("地址",$cols))?"<tr><th>地址</th><td>{$data\['zip'\]}{$data\['city'\]}{$data\['town'\]}{$data\['address'\]}</td></tr>":""; $main.=(in\_array("服務單位",$cols))?"<tr><th>服務單位</th><td>{$data\['company'\]}</td></tr>":""; $main.=(in\_array("職稱",$cols))?"<tr><th>職稱</th><td>{$data\['job'\]}</td></tr>":"";
$main.=" <tr><th>大頭照</th><td></td></tr> <tr><th>其他說明</th><td>{$data\['note'\]}</td></tr> </table>"; } return $main; } ?>
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
87
人線上 (
11
人在瀏覽
線上書籍
)
會員: 0
訪客: 87
更多…