線上書籍

Home

[1032]PHP入門

<!DOCTYPE html> <html lang="zh-TW"> <head> <meta charset="UTF-8"> <title>EZ佈告欄</title> </head> <body> <h1>最新消息</h1> <?php //echo 輸出,字串用雙引號包起來,變數放在字串中時,要加上{} echo "<h2>{$_POST['news_title']}</h2>"; // nl2br()將換行符號轉換為<br>標籤 $news_content=nl2br($_POST['news_content']); echo "<p>$news_content</p>"; ?> <!-- 連結 --> <a href="post.php">發布新聞</a> </body> </html>