八、發表部落格

來源:互聯網
上載者:User
PHP經典項目案例-(一)部落格管理系統5

本篇實現發表部落格。

八、發表部落格

(1)、介面實現file.php

                             
                                                   

                                               
   
           
                  
          

編輯文章時各個選項使用js實現:UBBCode.js

helpstat = false;basic = false;function AddText(NewCode) {document.all("file").value+=NewCode}function showsize(size) {if (helpstat) {alert("文字大小標記\n設定文字大小.\n可變範圍 1 - 6.\n 1 為最小 6 為最大.\n用法: 這是 "+size+" 文字");} else if (basic) {AddTxt="";AddText(AddTxt);} else {                       txt=prompt("大小 "+size,"文字"); if (txt!=null) {             AddTxt=""+txt;AddText(AddTxt);AddTxt="";AddText(AddTxt);}        }}function bold() {if (helpstat) {alert("加粗標記\n使文本加粗.\n用法: 這是加粗的文字");} else if (basic) {AddTxt="";AddText(AddTxt);} else {  txt=prompt("文字將被變粗.","請在這裡輸入要加粗的文字!");     if (txt!=null) {           AddTxt=""+txt;AddText(AddTxt);AddTxt="";AddText(AddTxt);}       }}function italicize() {if (helpstat) {alert("斜體標記\n使文本字型變為斜體.\n用法: 這是斜體字");} else if (basic) {AddTxt="";AddText(AddTxt);} else {   txt=prompt("文字將變斜體","請在這裡輸入要傾斜的文字!");     if (txt!=null) {           AddTxt=""+txt;AddText(AddTxt);AddTxt="";AddText(AddTxt);}        }}function showcolor(color) {if (helpstat) {alert("顏色標記\n設定文本顏色.  任何顏色名都可以被使用.\n用法: 顏色要改變為"+color+"的文字");} else if (basic) {AddTxt="";AddText(AddTxt);} else {       txt=prompt("選擇的顏色是: "+color,"請在這裡輸入要改變顏色的文字!");if(txt!=null) {AddTxt=""+txt;AddText(AddTxt);        AddTxt="";AddText(AddTxt);} }}function showfont(font) { if (helpstat){alert("字型標記\n給文字設定字型.\n用法: 改變文字字型為"+font+"");} else if (basic) {AddTxt="";AddText(AddTxt);} else {                  txt=prompt("要設定字型的文字"+font,"請在這裡輸入要改變字型的文字!");if (txt!=null) {             AddTxt=""+txt;AddText(AddTxt);AddTxt="";AddText(AddTxt);}        }  }function underline() {  if (helpstat) {alert("底線標記\n給文字加底線.\n用法: 要加底線的文字");} else if (basic) {AddTxt="";AddText(AddTxt);} else {  txt=prompt("底線文字.","文字");     if (txt!=null) {           AddTxt=""+txt;AddText(AddTxt);AddTxt="";AddText(AddTxt);}        }}


(2)後台添加到資料庫實現check_file.php

execute_dml($sql);        if($res==1){        echo "";        echo "";    }else{        echo "";        echo "";    }?>


  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.