PHP develops si...LOGIN

PHP develops simple news release system news release front-end page

In the previous section we created the database and tables and did some preparatory work. In this section we will make a simple adding news page

Adding news is to add data to the database. And displayed on the news list page later.

1604.png

The administrator fills in the content of the news in the form, including: title, author, and content.

Use the <form> form<input> text box to enter content.

The content in <textarea></textarea> in the page is used to get the content of the content field. Because there is too much content in this field, it can only Use this label.

The following is the HTML code of a simple news release page:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>新闻发布页面</title>
    <style type="text/css">
        span{display:inline-block; float: left; width: 55px}
        input[type="submit"]{margin-left: 30%;}
    </style>
</head>
<body bgcolor="#ccc">
    <form name="article" method="post" action="publish.php" style="">
        <h3 style="margin-left: 60px;">新闻发布页面</h3>
        标 题:<input type="text" name="title" style="width:200px"/>
        <br/><br/>
        作 者: <input type="text" name="author" style="width:200px"/>
        <br/><br/>
        <span>内 容:</span>
        <textarea cols=35 rows=8 name="content"></textarea><br/><br/>
        <input type="submit" value="发布新闻"/>
    </form>
</body>
</html>

You can name this page: new.php

Next Section
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>新闻发布页面</title> <style type="text/css"> span{display:inline-block; float: left; width: 55px} input[type="submit"]{margin-left: 30%;} </style> </head> <body bgcolor="#ccc"> <form name="article" method="post" action="publish.php" style=""> <h3 style="margin-left: 60px;">新闻发布页面</h3> 标 题:<input type="text" name="title" style="width:200px"/> <br/><br/> 作 者: <input type="text" name="author" style="width:200px"/> <br/><br/> <span>内 容:</span> <textarea cols=35 rows=8 name="content"></textarea><br/><br/> <input type="submit" value="发布新闻"/> </form> </body> </html>
submitReset Code
ChapterCourseware