Home >Backend Development >PHP Tutorial >[MarsZ]ThinkPHP project practical summary, marszthinkphp_PHP tutorial
The original word format of this article is Baidu cloud disk download address:
http://pan.baidu.com/s/1qYqZFkg
Review 2
Requirement 2
Author 2
System Overview 2
Unity3dClient 2
PHPBackend 4
Preparation 6
XAMPP 6
Official website 6
Download address 6
Tutorial 6
ThinkPHP 6
Official website 7
The project uses version 7
Download address 7
Quick Start 7
Complete Manual 7
Step 7
PrepareThinkPHP 7
ModifyMySQLsetting information 8
Detection is successful 9
Extensions: Controllers and Templates 9
Principle 9
Add controller method 9
Add interface template 10
Other functions can be deduced in the same way 10
Note 10
Thinkphp 10
Compare Tags 10
Data reading 10
Session 11
Unable to load database driver: ThinkDbDriver 11
PHP 11
PHPSelect all and delete 11
PHPProcessingCheckboxCheckbox form submission 11
HTML 12
HTMLFramework 12
HTMLHow does the frame jump to the same frame page (transfer) 12
MySQL 12
MySQLCreate database 12
The requirements this time are: a U3D application requires student login, student registration, and student password modification functions. The relevant backend needs to view the student list, modify student information, view the administrator list, and manage Functions such as modifying and adding employee information.
After comprehensive consideration, the backend adopts PHP language, ThinkPHP framework, and MySQL database.
Author of this article: MarsZ
QQ:569491198
Communication group: 498885177
Version: First Edition
Time: 2016Year3Month29Day 10:32:18
Nonsense: This project was a private job I took on after work. I did it in my spare time. It took about 20 hours. Although I am engaged in Unity3D, whether I was engaged in Flash web game development before or now I am engaged in U3D Mobile game development, or other things, PHP is a good back-end language that can fulfill many functional requirements. The first version has not been updated with the UI beautification, I’ll wait until I finish posting the summary. On the one hand, this summary is a reference for friends in need. On the other hand, it is also a habit of mine. If necessary, write down what you have done for your own reference in the future.
Unity3dRegistration at the front desk:
Unity3dRegistration at the front desk
Unity3d Front desk login:
Unity3dfront desk login
Unity3d Front desk password retrieval:
Unity3dChange front desk password
Note: This version is the first version and has not been updated with UI beautification.
Backend login
Backstage Home Page-Student List
Backstage Home Page-Student Information Editing
Backstage Home Page-Account Management
Backstage Home Page-New Administrator
(Apache MySQL PHP PERL) is a powerful buildXAMPP software station integration software package. After installation, No need to install Apache, MySQL and PHP.
http://www.xampps.com/
http://www.xampps.com/xampp.zip (required)
Installation method: One-click installation mode after downloading the installation package, fool-proof, no explanation required
http://www.thinkphp.cn/
http://www.thinkphp.cn/down/610.html
http://www.thinkphp.cn/down/610.html (required)
http://www.kancloud.cn/thinkphp/thinkphp_quickstart (recommended)
http://www.kancloud.cn/manual/thinkphp (Reference)
DownloadThinkPHP and extract it to the website directory. The directory structure after decompression is xampphtdocsArtStudio:
Website Directory
The configuration file is located at: xampphtdocsArtStudioApplicationCommonConfconfig.php MySQLConfiguration modification
Detection is successful
can access the Index
controller's index method of the Admin module, see We’ve reached the homepage.
Extensions: Controllers and Templatesunder xampphtdocsArtStudioApplicationAdminController Add a method: public function login($as_admin_name,$as_admin_password)
.Given2
parameters$as_admin_name, $as_admin_password.
Controller method
Add interface template
template under xampphtdocsArtStudioApplicationAdminViewIndex, Create a form and submit it to __URL__/login
, corresponding to thelogin method in the controller, Pass in 2
parameters.Other functions can be deduced in the same way
Format:
Equal
Not equal
Example:
Data reading
Example:
$User = M("User"); //
instantiateUserobject // Get the nickname of the user whose ID
is3 $nickname = $User->where('id=3')->getField('nickname');
SessionReference:
Format: session('name','value'); //
Settingssessionsession('name',null); // Deletenam
Example:
session('user.user_id',10); //
Settingssessionsession('user.user_id',null); // Deletesession
Unable to load database driver: ThinkDbDriver
PHP PHP
PHPProcessing
Checkbox
HTML HTML
HTMLHow to jump to the same frame page in HTML
MySQL
MySQLExample:
CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci; USE DATABASEName;//Please note that the database name does not include quotation marks