簡單版發布留言案例

2022-08-19 13:06:12 字數 1338 閱讀 4138

案例分析:

1.點選按鈕之後就動態建立乙個 li;

2.建立 li 的同時,把文字域裡面的值通過 innerhtml 賦值給 li;

效果:

="請輸入您想要發布的內容"

>

textarea

>

37<

button

>發布

button

>

38<

ul>

3940

ul>

41body

>

42<

script

>

43//

1.獲取元素

44var

btn=

document.queryselector(

"button");

45var

text

=document.queryselector(

"textarea");

46varul=

document.queryselector("ul

");47//

2.註冊事件

48btn.onclick

=function

()52

else62}

63script

>

64html

>

中環留言版

中環留言版是以php mysql為基礎的留言板系統。由於v1存在的問題比較多。好多朋友跟我反應都是路徑的問題導致頭像或者是表情之類無法使用。這次v2採用oop開發。不管是 方面,還是資料庫方面,都做了大量優化。安全性更高。進入membet資料夾找到dbconfig.php修改你的mysqli使用者名...

簡單PHP留言板之五 留言列表

檔名 list.php 說明 mysql fetch array mysql fetch array data,array type 函式從結果集中取得一行作為關聯陣列,或數字陣列,或二者兼有 返回根據從結果集取得的行生成的陣列,如果沒有更多行則返回 false。data 可選。規定規定要使用的資料...

php mysql簡單留言,適合新手

html head title title style p,textarea style head body form action submit.php method post p 名字 input type text name username p ptextarea cols 30 rows ...