PHP Classic Project Case-(a) blog management system 5
The implementation of this blog post.
Viii. Publishing Blog
(1), Interface realization file.php
When editing an article, each option uses the JS implementation: Ubbcode.js
Helpstat = False;basic = False;function AddText (newcode) {document.all ("file"). Value+=newcode}function showsize (size) {if (helpstat) {alert ("Text size tag \ n" Sets the text size. \ n Variable range 1-6.\n 1 is the minimum of 6 for maximum. \ n Usage:
This is "+size+" text");} else if (Basic) {addtxt= ""; AddText (addtxt);} else {txt=prompt ("size" +size, "text"); if (txt!=null) {addtxt= "" +txt; AddText (Addtxt); Addtxt= ""; AddText (addtxt);} }}function Bold () {if (Helpstat) {alert ("bold mark \ n makes text bold. \ n Usage:
It's a bold text.");} else if (Basic) {addtxt= "
"; AddText (addtxt);} else {txt=prompt ("The text will be thicker.", "Please enter the text to be bold here!") "); if (txt!=null) {addtxt= "
"+txt; AddText (Addtxt); Addtxt= ""; AddText (addtxt);} }}function italicize () {if (Helpstat) {alert ("italic tag \ n makes the text font italic. \ n Usage:
This is the italic word .");} else if (Basic) {addtxt= "
"; AddText (addtxt);} else {txt=prompt ("text will be italic", "Please enter the text you want to tilt here!") "); if (txt!=null) {addtxt= "
"+txt; AddText (Addtxt); Addtxt= ""; AddText (addtxt);} }}function Showcolor (color) {if (Helpstat) {alert ("colour tag \ n" Sets the text color.) Any color names can be used. \ n Usage:
The
color to be changed to "+color+");} else if (Basic) {addtxt= ""; AddText (addtxt);} else {txt=prompt ("The Color chosen is:" +color, "Enter the text you want to change the color here! "); if (txt!=null) {addtxt=" "+txt; AddText (Addtxt); Addtxt= ""; AddText (addtxt);} }}function Showfont (font) {if (Helpstat) {alert ("font tag \ \ \ \ \ \ \ \ \ \ \ n"): Change the text font to "+font+");} else if (Basic) {addtxt= ""; AddText (addtxt);} else {txt=prompt ("text to set font" +font, "Enter the text you want to change the font here! "); if (txt!=null) {addtxt=" "+txt; AddText (Addtxt); Addtxt= ""; AddText (addtxt);}
}}function underline () {if (Helpstat) {alert ("underline mark \ n underlines the text. \ n Usage:
to underline the text ");} else if (Basic) {addtxt= "
"; AddText (addtxt);} else {txt=prompt ("underlined text.", "text"); if (txt!=null) {addtxt= "
" "+txt; AddText (Addtxt); addtxt= ""; AddText (addtxt);} }}
(2) Add background to database implementation check_file.php
EXECUTE_DML ($sql); if ($res ==1) { echo ""; echo ""; } else{ echo ""; echo ""; }? >