[MarsZ] ThinkPHP project Practice summary, marszthinkphp_PHP tutorial

Source: Internet
Author: User
[MarsZ] ThinkPHP project Practice summary, marszthinkphp. [MarsZ] ThinkPHP project Practice summary, marszthinkphp this article original word format baidu Cloud Disk: pan. baidu. coms1qYqZFkg Summary 2 requirements 2 Author 2 System Overview 2Unity3d guest [MarsZ] ThinkPHP project Practice summary, marszthinkphp

Baidu cloud disk in the original word format:

Http://pan.baidu.com/s/1qYqZFkg

Summary 2

Requirement 2

Author 2

System Overview 2

Unity3d client 2

PHP background 4

Preparation 6

XAMPP 6

Official website 6

6

Tutorial 6

ThinkPHP 6

Official website 7

Project version 7

7

Quick start 7

Full manual 7

Step 7

Prepare ThinkPHP 7

Modify MySQL settings 8

Check successful 9

Extended: Controller and template 9

Principle 9

Add controller method 9

Add an interface Template 10

Other features, so forth, 10

Note 10

Thinkphp 10

Compare tags 10

Read Data 10

Session 11

Unable to load database Driver: Think \ Db \ Driver \ 11

PHP 11

PHP select and delete all 11

PHP processes Checkbox check box form submission 11

HTML 12

HTML framework 12

How does the HTML framework perform page jump (to) with the same framework 12

MySQL 12

MySQL database creation 12

Summary Requirement

This requirement is: a U3D application requires student login, student registration, and student password modification, related background functions such as viewing the student list, modifying student information, viewing the administrator list, modifying and adding administrator information are required.

After comprehensive consideration, the backend uses the PHP language, ThinkPHP framework, and MySQL database.

Author

Author: MarsZ

QQ: 569491198

Communication Group: 498885177

Version: First version

Time: March 29, 2016 10:32:18

Nonsense: This project is a private activity in my spare time. it took me about 20 hours to get started in my spare time. Although I am engaged in Unity3D, PHP is a good background language, no matter whether I used Flash browser game development, U3D mobile game development, or others, it can meet many functional requirements. UI beautification is not added to the first version. This conclusion is for reference to friends who need it. it is also a habit of yourself. if you have done something necessary, write it down for your reference.

System Overview Unity3d client

Unity3d front-end registration:

Unity3d front-end registration

Unity3d front-end login:

Unity3d front-end login

Unity3d foreground password retrieval:

Unity3d foreground password modification

PHP background

Note: This version is the first version without UI beautification.

Background login

Background homepage-student list

Background homepage-student information Editing

Background homepage-account management

Background homepage-new administrator

Preparation XAMPP

(Apache + MySQL + PHP + PERL) is a powerful software package for XAMPP software station integration. after installation, you do not need to install Apache, MySQL, and PHP.

Official website

Http://www.xampps.com/

Http://www.xampps.com/xampp.zip (required)

Tutorial

Installation method: One-click installation mode after the installation package is downloaded. it is silly and does not need to be explained.

ThinkPHP Official website

Http://www.thinkphp1.cn/

Version used by the project

Http://www.thinkphp1.cn/down/610.html

Http://www.thinkphp1.cn/down/610.html (required)

Quick start

Http://www.kancloud.cn/thinkphp/thinkphp_quickstart)

Full Manual

Http://www.kancloud.cn/manual/thinkphp (reference)

Procedure Prepare ThinkPHP

Download ThinkPHP and decompress it to the website directory. after decompression, the directory structure is xampp \ htdocs \ ArtStudio:

Website Directory

Modify MySQL settings

The configuration file is located in config. php of xampp \ htdocs \ ArtStudio \ Application \ Common \ Conf:

MySQL configuration modification

Check successful

Http: // localhost/ArtStudio/index. php/Admin/Index/index

You can access the Index method of the index controller of the Admin module. the homepage is displayed.

Scaling: Controllers and templates Principles

The method used to submit data to the controller in the template. if there is a parameter, the parameter is passed in.

Add controller method

Open IndexController. class. php under xampp \ htdocs \ ArtStudio \ Application \ Admin \ Controller

Add a method: public function login ($ as_admin_name, $ as_admin_password ).

Specify two parameters $ as_admin_name and $ as_admin_password.

Controller method

Add an interface Template

Open the index.html template under xampp \ htdocs \ ArtStudio \ Application \ Admin \ View \ index,

Create a form and submit it to/index. php/Article/login. it corresponds to the login method in the controller,

Input two parameters.

Other features and so on

Note: Thinkphp Compare tags

Refer:

Http://document.thinkphp1.cn/manual_3_2.html#compare

Format:

Equal

Not Equal

Example:

{$ Vo. name}

Data reading

Refer:

Http://document.thinkphp1.cn/manual_3_2.html#read_data

Example:

$ User = M ("User"); // instantiate the User object

// Obtain the nickname of a user whose ID is 3

$ Nickname = $ User-> where ('Id = 3')-> getField ('nickname ');

Session

Refer:

Http://www.kancloud.cn/manual/thinkphp/1872

Format:

Session ('name', 'value'); // sets the session

Ession ('name', null); // delete nam

Example:

Session ('user. user_id ', 10); // sets the session

Session ('user. user_id ', null); // delete a session

Unable to load database Driver: Think \ Db \ Driver \

Refer:

Http://www.thinkphp1.cn/topic/29611.html

PHP PHP selection and deletion

Refer:

Http://blog.163.com/iamphex@yeah/blog/static/853658012011118033893/

PHP processes Checkbox check box form submission

Refer:

Http://blog.csdn.net/sysprogram/article/details/42693295

HTML HTML framework

Refer:

Http://www.w3school.com.cn/tiy/t.asp? F = html_frame_navigation2

Http://www.w3school.com.cn/tiy/t.asp? F = html_frame_mix

How does an HTML framework redirect to a page of the same framework)

Refer:

Http://zhidao.baidu.com/link? Url = response

MySQL Create a database in MySQL

Refer:

Http://outofmemory.cn/code-snippet/2533/mysql-create-database-specify-utf-8-coding

Example:

Create database if not exists yourdbname default charset utf8 COLLATE utf8_general_ci;

USE DATABASEName; // note that database names are not enclosed in quotation marks

In this paper, the original word format Baidu Cloud Disk: http://pan.baidu.com/s/1qYqZFkg Overview 2 requirements 2 Author 2 System list 2 Unity3d customers...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.