How to post news on PHP website without modifying http page?

With the news script, you can post news on your PHP website without modifying your http page.

The realization of the news script

You need to know:

- Working with a database
- Working with forms
- Working with dates and timestamp.

By combining databases and forms, you can perform most of the common scripts !

You will need to separate your script into pages. You will simply need to :
- A page displaying the various news (usually this is the home page)
- A page for writing your news (is therefore a page containing a form for entering these news)
- Inserting a page news in your database.

The news script in PHP consists of two major parts:

-The display news: this script will show by example the last five news on your homepage. This is a very simple script to achieve: a query in the database. In general, the display of news is in the host file of your site (index.php).
- Administration: It includes two PHP pages from which you can add, modify, delete news. These pages should be protected by .htaccess to prevent anyone can have fun writing news.

Finally you must know three little functions that we need to think about using: nl2br, addslashes and stripslashes.
- nl2br: used to save you typing the line breaks in HTML.
- addslashes: in fact, it is not always required to use this feature depending on your web host. But it is better to take the good habit of using it. So before recording the title and content of the news, you apply them addslashes.
- stripslashes: This function does the opposite. Use it just before the title display and content of the news to avoid that one way backslash.

You will especially need these features in the page that displays the news to your visitors ( index.php ) . Keep in mind when you write a news item that you can type HTML.

For all informations about php development, click here !

Les publications similaires de "Application"

  1. 20 Avril 2021Staying creative and innovative as a comapny291 visites
  2. 1 Mars 2021Elite Print, how to change your page presentation easily !361 visites
  3. 28 Janv. 2021New frameworks empowered PHP to do bigger and greater things454 visites
  4. 19 Nov. 2020The services offered by leading Php companies653 visites
  5. 19 Sept. 2020Focus on improving in the field of Php programming530 visites
  6. 6 Juil. 2020Put and keep together all your facebook memories675 visites