Quick start with 1.0EcShop-preface this article is copyrighted by Li Dequan. For more information, see
After a friend's call, Lao Li found a PHP development platform of Zend Studio and tried it for a while. basically, all required functions were available, so he made up his mind to use it. I cannot find the project file in the source file of ecshop, but it is hard to find Lao Li. The entrance page of the mall is index. php. open the index. php file first, and set a breakpoint at the beginning. The result is really good. Some may ask, why not start with the architecture? Why not start with the template mechanism? Lao Li thinks this way. The Course 0. x on the road to EcShop is about some basic development knowledge, such as PHP, smarty, and MySQL. master should pay attention to the subsequent EcShop architecture!
Back to the truth, in the debugging window, Lao Li saw a lot of unknown variables (such as). Where did he come from? What is it?
The following describes some basic knowledge. As we all know, any development language is variable (nonsense, haha), and PHP is the same. PHP variables are divided into two parts. one part is user-defined variables. values can be assigned with values or referenced values (the difference lies in whether the memory is shared ). The other part is the PHP pre-defined variables we will talk about below. by operating the PHP pre-defined variables, we can get information such as user sessions, user operating system environments, and local operating system environments.
Variable name |
Description |
$ GLOBALS |
Is an array composed of all defined global variables. The variable name is the index of the array. It can be called a super set of all super variables. |
$ _ COOKIE |
The information transmitted to the script through HTTPCookie. Most of these cookies are set by the setcoke () function when PHP scripts are executed. |
$ _ ENV |
Variables submitted to the script in the execution environment. Similar to the old array $ HTTP_ENV_VARS array (still valid, but not used) |
$ _ FILES |
Variables submitted to the script by uploading the http post file. Similar to the old array $ HTTP_POST_FILES array (still valid, but not used) |
$ _ GET |
Contains information about the parameters passed through the GET method. It is mainly used to obtain data submitted through the GET method. |
$ _ POST |
Contains information about the parameters passed through the POST method. It is mainly used to obtain data submitted through the POST method. |
$ _ REQUEST |
This array is not trustworthy because the GET, POST, and COOKIE mechanisms are used to submit scripts to variables. |
$ _ SERVER |
Variables set by the Web server or directly associated with the execution environment of the current script, such as the server IP address and host name |
$ _ SESSION |
Contains information related to all session variables. It is mainly used for session control and value transfer between pages. |
After completing the pre-defined variables, Lao Li suddenly felt that there was nothing to talk about. It is nothing more than the control statement if... elseif... Else, loop statement while, do... While, foreach, etc., but we still need to remind everyone, pay attention to the difference between double quotes and single quotes. As for cookies and sessions, no matter which development platform is used in BS programs, it is a meaning. Well, Lao Li can't wait to see MySQL.
1.0 EcShop opening-Preface
1.1 EcShop path-installation
1.2 path to EcShop-PHP
1.3 Path to EcShop-MySQL
1.4 Path to EcShop-Smarty