PHP system summary sharing
This article mainly shares with you the relevant knowledge of PHP system summary, hoping to help everyone.
1. About session
session_start();
$_SESSION['id']=time();//Use session to fill in the questionnaire for each person Users have a randomly assigned ID so that their data updates can be stored in the database.
After that, for each web page that needs to use $_SESSION['id'], you must first add
session_start();
and then use the mysqli_query language to operate the database.
You need to pay attention to the update operation code here:
1 2 3 |
|
1 |
|
Because quotation marks cannot appear continuously in a string, otherwise it will be truncated. So the correct code uses a square bracket {} to enclose the middle quotation marks. I have never written this correctly before, which resulted in me being unable to use the session.
2. About Chinese information encoding format
1 2 3 4 5 |
|
So, in the future, everyone must pay attention to 4 points when using the database to enter Chinese information:
(1 ) PHP document format utf-8
(2) Header title utf-8
(3) Database varchar() format setting utf-8
(4) Add mysqli_query($con, 'set names utf8');
The code of the pop-up window in 3.php
It was originally a very simple line of code, but the search on the Internet was wrong. I think maybe every The formats written by individuals are different, and the applicable PHP versions are also different. As a result, the pop-up window cannot be displayed correctly every time I use other people's code. Finally, I got the answer through the knowledge gained from asking friends and searching. The code is as follows:
1 |
|
4. Use html code to automatically jump to the web page function
1 2 3 4 5 6 7 8 |
|
5. Each page must fill in complete restrictions
1 2 3 |
|
6. Drop-down menu, and post transmission to another web page to accept drop-down menu information
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
The first time to take on a real php project, I'm very excited, but really tired
I remember the first time I used PHP to write a student management system, there were several places that were wrong no matter how I modified them, and I still couldn't find the answer after searching Baidu. I have been troubled for a long time. This time the questionnaire system has modified the problems of the last student management system and implemented some new functions.
The summary has not been finished yet and will be updated in the near future. It was just handed over to the demander today, and the demander pointed out several points for improvement. I'll make more changes.
This time when I took on the project, I really found that my foundation was not strong. There are many codes that I only know roughly, but I am completely ignorant about the details. The result is that I may have to think about a very simple line of code for several hours, resulting in very low efficiency. I hope these details can be resolved by doing more projects and asking more questions. Another thing I want to say is that sometimes people forget how to write code and search Baidu, but often they can’t find the results they want (or the code is invalid). This may be due to the format of each person’s code and the version of the language they use. Different people cause these mistakes, so if there are masters around you, try to ask the masters around you for advice!
1. About session
session_start();
$_SESSION['id']=time();//Use session to fill in the questionnaire for each person Users have a randomly assigned ID so that their data updates can be stored in the database.
After that, for each web page that needs to use $_SESSION['id'], you must first add
session_start();
and then use the mysqli_query language to operate the database.
You need to pay attention to the update operation code here:
1 2 3 |
|
1 |
|
Because quotation marks cannot appear continuously in a string, otherwise it will be truncated. So the correct code uses a square bracket {} to enclose the middle quotation marks. I have never written this correctly before, which resulted in me being unable to use the session.
2. About Chinese information encoding format
1 2 3 4 5 |
|
So, in the future, everyone must pay attention to 4 points when using the database to enter Chinese information:
(1 ) PHP document format utf-8
(2) Header title utf-8
(3) Database varchar() format setting utf-8
(4) Add mysqli_query($con, 'set names utf8');
The code of the pop-up window in 3.php
It was originally a very simple line of code, but the search on the Internet was wrong. I think maybe every The formats written by individuals are different, and the applicable PHP versions are also different. As a result, the pop-up window cannot be displayed correctly every time I use other people's code. Finally, I got the answer through the knowledge gained from asking friends and searching. The code is as follows:
1 |
|
4. Use html code to automatically jump to the web page function
1 2 3 4 5 6 7 8 |
|
5. Each page must fill in complete restrictions
1 2 3 |
|
6. Drop-down menu, and post transmission to another web page to accept drop-down menu information
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
第一次接一个真正的php项目,很激动,不过确实累啊
记得第一次用php写学生管理系统的时候,有好几个地方怎么修改都不对,搜百度也依旧没有答案。苦恼了很久。这次的问卷调查系统修改了上次学生管理系统的问题,并新实现了一些功能。
总结还没写完近期将持续更新,今天刚交给需求方,需求方又指出几点要改进的地方。我再做修改。
这次接项目也是真的发现自己的基础不牢啊。有多的代码只是大概知道,而对于细节方面简直小白,造成的结果是,一行很简单的代码,我可能要想几个小时,造成效率很低。这些细节希望通过多做项目,多问问题得到解决。还想说一个就是,大家有时候忘了代码怎么写就去搜百度,但是经常搜不到自己想要的结果(或者说代码无效),这可能就是每个人写代码的格式以及使用语言的版本不同造成这些错误的,所以,若周围有大神,还是尽量向身边的大神请教吧!
相关推荐:
The above is the detailed content of PHP system summary sharing. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.
