php考核反思
php第一阶段考总结
先说学习php阶段吧,因为从学长那里知道学php的话,《细说php》这本书比较好,所以我们这个阶段都用了这本书。
这本书太厚了,因为时间有限,所以当时就是大致把这本书看了一遍,当看完后,准备开始做的时候,才发现,原来看的东西基本上都忘完了,但是已经没有时间了再重新再看一遍了,就开始写了。
php基础,其实还是比较简单的,只要将一个异步提交的流程及一些基本的php,js,html,apache它们之间的联系及原理弄明白了,个人感觉基础阶段就够用了。所以最痛苦的是刚开始写的那几天。刚开始那几天,因为异步提交的格式及流程不太清楚,所以程序就光报错。
还有sublime还不会提示哪错了,找错就特别不容易,有时候一个sql语句写错了,需要看四五遍,甚至更多。后来找学长、学姐,让他们帮忙找问题。我就慢慢学会简单调试。
还有一个就是POST、GET提交问题,原来我一般都用post,因为感觉post比较安全。后来发现了一个问题:我用ajax把数据用post提交过去,将结果输出后,双击那个结果产生的链接,打开后,那个界面就空了,,但是用get可以实现。。
所在那以后如果是处理 数据库,或判断什么东西,我都用post提交;如果是在php直接输出html界面,我就用get提交。然而当时并不知道原因
后来,我这个程序基本上昨完了,去问学长,这才真正明白,post与get的真正区别
post就是专门用来后台处理提交的数据,然后返回一个结果,,然后用js,对dom模型操作;
get是提交数据后,处理后可以直接在php界面当成html输出,,get处理后返回的是一个html界面
还有就是数据类型 json刚开始也不了解,后来,听学长讲课才知道原来json里面可以嵌套好多层
在5月19日晚上进行了php第一阶段考核,在考核前感觉自己做的个人博客系统还不错,但是,考核时,有感觉自己的东西不好,出现了好多问题,特别是与安全(权限、重复登录、刷访问量、下载文件)问题,这些问题当时在写的时候,完全没有考虑到。
还有我大部分html是直接在前台输出的,,所以echo用的太多了,写了好多字符串,我感觉这点都不太好,但当时如果全部都用ajax又嫌太麻烦。所以到最后还是直接在php里直接输出了。
问题:
1.对于cookie和session,刚开始不会用header跳转,我就用js判断cookie,,后来,用php判断session,,用echo输出js标签,在那里面用js跳转
2.对于多次登录问题:我在数据库中user表中加了两个字段:user_ip(用户登录ip)、state(用户登录状态)
3.回复问题,现在还没有改好,还是存在一定的不合理性
4.UE插件图片上传(upload) (设置文件夹权限)
5.文件路径不能存入数据库,只能把文件名存入数据库,然后通过配置文件中的一个量是文件所在目录,将它们拼接起来,来获取其路径
6.对于图片预览问题:修改了model,在图片名前加了个img标签,来展示图片
本次刚接触php,许多语法等东西还不熟悉,所以程序有很大的局限性,并且没用用到面向对象的思想。。这点以后要特别注意。。

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



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...
