PHP Half Way Home (3) Preface
Reflecting on some of the recently written things, I feel a little bit
For coder that has learned java or C ++,
The syntax is meaningless, such as OOP and exceptions.
Instead of simply looking at the instance code,
If you don't understand it, you can google it ~
START!
I am not writing dead knowledge on the blog for the time being. I suggest you write a blog on the blog for the time being ~
The plan is the first instance in the Practical PHP and MySQL book.
Requires a good storage model
Three tables to be created in the database
Match data with related IDs
General logic framework of blog
Config. php
Function: provides constants, which are generally simple configurations.
Content:
Database --- [host] [username] [password] [dbname]
Blog-[blog name] [author] [root directory of the homepage]
Header. php
Function: initialize each blog page.
Content:
Top blog title of each page --- html
Database Connection --- MySQL
Login verification-after correct login, you can perform blog management-SESSION
Footer. php
Function: add the author flag at the bottom of each page.
Content:©Matter
Index. php
Function: Display articles, view comments, and display previous articles
Content:
Query articles in the database --- MySQL
Show article title and content --- PHP
Viewentry. php
Function: use the anchor to view comments and add comments.
Content:
Verify first and GET the ID number --- GET
Connect to the database and find the article with the corresponding ID --- MySQL
Find all comments --- MySQL
Show articles, comments --- php
Form for submitting comments --- html
Viewcat. php
Function: classified browsing
Content:
Determine the request id --- php
Show all articles under the corresponding ID --- MySQL
Login. php
Function: login --- session
Logout. php
Function: logout --- session
Addentry. php
Function: add an article
Content:
Verify user --- session
Write category and article --- html
Add content to database
Updateentry. php
Function: modify an article
Content:
Verify
Database UPDATE command
Small gains in coding
1. date () time format
Date () |
Date |
D |
Sat |
D j |
Sat 12 |
D jS |
Sat 12th |
D jS F |
Sat 12th May |
D jS F Y |
Sat 12th May 2012 |
D jS f y g |
Sat 12th May 2012 3 |
D jS f y g. |
Sat 12th May 2012 3. |
D jS f y g. I |
Sat 12th May 2012 3.06 |
D jS f y g. iA |
Sat 12th May 2012 3.06PM |
2. when designing a page, you can use the header and footer files to produce a fixed effect.
3. simple SQL statement format: SELECT (SELECT) -- WHERE (condition) -- ORDER BY (SORT) -- DESC (reverse) -- LIMIT (LIMIT)
4. use the config. php file to save some configuration information constants.
5. usage overview of $ _ GET and $ _ POST Super global variables
6. programming practices for databases and web pages
Small feelings
This is my first PHP + MySQL Applet. the motivation for doing this is to learn PHP and think that the syntax is in place. I want to try it, but I have encountered a lot of difficulties.
Good aspect
I learned how to deploy a BLOG on a server and how it works.
Have some understanding of PHP's role in programming
Use MySQL to interact with pages
I have learned about the anchor, session, and other content that I have previously heard.
Bad aspect
I don't have enough overall experience in coding with books (it's clear to summarize it in my blog ).
The HTML layout and CSS style are not well mastered. These two aspects lead to the inexplicable disorder of my pages.
In addition, the SQL language is not very good at understanding, but it will only be very "simple" operations, and it is obvious that you have not mastered it.
In short, I have a clear sense of direction for myself to learn PHP. I hope I can continue to work harder in the future !!!