Home  >  Article  >  Backend Development  >  How to build a personal small blog using PHP?

How to build a personal small blog using PHP?

WBOY
WBOYOriginal
2016-08-26 10:13:571355browse

I want to know what the specific steps should be. I am a beginner and want to try it. Please give me some advice! Thank you

Reply content:

Proudly powered by typecho. blog.endaosi.com

typecho is a modern wordpress-like blog, using mvc mode, the main body is framework + widget, login and register are widgets rather than coupled in the core. This refreshing and refined experience is truly unprecedented, both the core code and the template code are very concise. WordPress is an old thing, and people who build websites or write templates may still need it (because there are many templates and plug-ins), but for PHP programmers who are obsessed with code, Typecho is the best choice. Z-Blog welcomes you!
Well, it’s the ASP Z-Blog, which has released a PHP version for more than a year.
Official website: Z-Blog official website, PHP blog system and ASP blog program, personal website building CMS system
Source code: zblogcn/zblogphp · GitHub

If you install it locally, you can directly use APMServ, PHPNow and other tools, or you can use IIS + windows.php.net to do it.
Installation tutorial on Sina App Engine: Z-BlogPHP 1.3 Wonce cloud host version (SAE, BAE)
Installation tutorial on BAE: Z-BlogPHP 1.3 Wonce cloud host version (SAE, BAE)

(Tip: If If you feel that 1.3 is unsatisfactory in some aspects, please look forward to version 1.4; the beta version is expected to be released during New Year's Day. This version has many optimizations of program functions, so stay tuned) If you want to build it, just search for WordPress tutorials.


If you want to create, here is a simple idea:

A blog needs a database to store data, so first think about the table structure of the database. For example, user table, article content table, classification table, etc.

Then use PHP to connect to the database and query. For example, for a post.php file, use the get method post.php?id=34 to get 34, get the article content table of the database to query the article, and then mix it into the HTML structure of post.php and insert the data into the corresponding structure. That's OK. In the same way, index.php gets all the article data from the database and loops it out. The same is true for the category page, but it only adds an additional query condition when querying the database. For paging, just divide it by the number of data you got.

If you log in to the backend, compare the username and password of the database and jump to the backend page. The background page is just a form. After filling it out, post it to the processing PHP. The processing PHP will insert the obtained database into the database. The front and backend are separated, PHP writes the backend interface and accesses the database, nginx serves as the web server, and is configured to access php-fpm. Front-end html5+CSS3+js+ajax calls the backend interface Simple:
1, php and mysql link (learn the basics of database)
2, blog form submission action=. method=.
3. Form data processing (data is stored in mysql insert into... values...)
4. Blog display (get parameters between web pages, mysql query, select * from...)

Complex ones:
1 , based on the previous steps, add image upload
2, blog sorting, paging, search, number of clicks
3, add existing editor ueditor, etc. Use WORDPRESS, it’s easy to use, easy to learn, free, and has a lot of plug-ins.

My blog uses a self-written framework, and the front-end uses pure css and kissy.

www.tiyee.net

I think you can try Secretary Li’s php blog: lishuji.cn. It’s okay and convenient for you to build your own website. If you want to keep it small, it is not a bad idea to start from scratch; here is a blog written in thinkphp for reference: shuaibai123/thinkbjy wordpress is very suitable.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn