Toggle main menu visibility
新聞
下載
教材
影音
討論
其他選單
好站連結
行事曆
電子相簿
常見問題
萬用表單
即時留言簿
友站消息
社大學員
:::
登入
登入
帳號
密碼
登入
重整畫面
:::
所有書籍
「[981]PHP入門+XOOPS模組設計」目錄
MarkDown
11-1 index.php
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
12. $xoopsUser應用
\[981\]PHP入門+XOOPS模組設計 ====================== <?php $root\_pass="12345"; //資料庫root密碼 $db\_name="test"; //資料庫名稱 /\* 連資料庫檢查 \*/ $link=mysql\_connect("localhost","root",$root\_pass); //資料庫連線 mysql\_select\_db("test"); mysql\_query("SET NAMES 'utf8'"); //設定語系 error\_reporting(0); include\_once "up\_file.php"; if($\_POST\['op'\]=="save"){ save\_event(); } //儲存事件 function save\_event(){ $sql="insert into diary (`date`,`event`) values ('{$\_POST\['date'\]}','{$\_POST\['event'\]}')"; mysql\_query($sql) or die($sql); $sn=mysql\_insert\_id(); upload\_file("diary\_sn",$sn); header("location:index2.php"); } //讀取事件的下拉選單 function select\_event($select\_sn=""){ $sql="select \* from diary order by date desc , sn"; $result=mysql\_query($sql) or die($sql); $main="<select onChange=\\"location.href='index2.php?sn='+this.value\\"> <option value=''>撰寫日記</option>"; while(list($sn,$date,$event)=mysql\_fetch\_row($result)){ $selected=($select\_sn==$sn)?"selected":""; $main.="<option value='$sn' $selected>$date</option>"; } $main.="</select>"; return $main; } //讀取某個事件 function show\_event($sn=""){ if(empty($sn))return; $sql="select \* from diary where sn='$sn'"; $result=mysql\_query($sql) or die($sql); list($sn,$date,$event)=mysql\_fetch\_row($result); $pic=show\_files("diary\_sn",$sn); $main="<div class='page'> $event $pic </div>"; return $main; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel='stylesheet' type='text/css' media='screen' href='style.css' /> <title>我的記事本</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/jquery\_ui\_datepicker/jquery\_ui\_datepicker.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('#date').datepicker({ userLang : 'zh-TW', americanMode: false, dateFormat: 'yy-mm-dd' }); }); </script> <script src="js/jquery\_ui\_datepicker/i18n/ui.datepicker-zh-TW.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="js/jquery\_ui\_datepicker/smothness/jquery\_ui\_datepicker.css"> <script src="upload/jquery.MultiFile.js"></script> </head> <body> <?php echo show\_event($\_GET\['sn'\]);?> <form action="index2.php" method="post" enctype="multipart/form-data"> 日期:<input name="date" type="text" id="date" size="20"> <?php echo select\_event($\_GET\['sn'\]);?><br> 插圖:<input type='file' name='upfile\[\]' class='multi' maxlength=5> <?php list\_del\_file("diary\_sn",$sn);?> <input type="submit" value="儲存" id="submit"><br> <textarea name='event' cols=80 rows=15 class="ckeditor"></textarea> <input name="op" type="hidden" value="save"> </form> </body> </html>
:::
搜尋
search
進階搜尋
QR Code 區塊
快速登入
所有討論區
「PHP全端開發」線上課程討論區
XOOPS使用討論區
一般研習學員
社大學員專用
路過哈啦區
XOOPS佈景設計
XOOPS模組開發
Tad書籍區
即時留言簿
書籍目錄
展開
|
闔起
線上使用者
50
人線上 (
6
人在瀏覽
線上書籍
)
會員: 0
訪客: 50
更多…