我想創(chuàng)建一個(gè)帶有大部頭條目的評(píng)論框。例如John S.:這是一條評(píng)論。發(fā)送:下午 3:24這是我的代碼。有人可以幫我弄這個(gè)嗎?<form method="post"> <textarea name="txt" cols="25" rows="5" placeholder="Type here your comment!" required="required"></textarea> <br><input type="submit" value="Submit" name="submit" /><?php if ( isset( $_POST[ 'submit' ] ) ) { $com = $_POST[ "txt" ]; $file = fopen( "inrg.txt", "a" ); fwrite( $file, "<br> <font color=\"#44b9df\"><em>User:</em></font> " ); for ( $i = 0; $i <= strlen( $com ) - 1; $i++ ) { fwrite( $file, $com[ $i ] ); if ( $i % 37 == 0 && $i != 0 ) fwrite( $file, "<br/>" ); } fwrite( $file, "<br><hr>" ); fclose( $file ); } ?> <br> </form> </div> <div class="commentcard"><a name="comments"><font face="Times New Roman"><b><p class="commentcimsor">Comments: </p></b></font><font face="Comic Sans MS" color="#000" size="4"><div class="commentscroll"> <?php if (file_exists("inrg.txt")) { $file = fopen( "inrg.txt", "r" ); echo fread( $file, filesize( "inrg.txt" ) ); fclose( $file ); } ?>
帶時(shí)間輸入的 PHP 注釋部分
繁華開(kāi)滿(mǎn)天機(jī)
2023-11-03 20:29:02