PHP初探感想

Jun 23, 2016 pm 02:32 PM

  仔细想来,我学php有整整一年半的时间了,而我接触网页设计才仅仅有2年时间,虽然时间很短,所学的东西仍非常有限,不能和各位网络大师相比,然每个人都有不同的学习方法和感悟,写出来供各位指点评论,也未必不是件好事
    也就是在2年前,我才开始学最基本的html标记,因为朋友要做个站,所以就下载了当时比较有名的动网asp论坛来搞,那时候也只是在论坛里找些代码尝试着粘贴到合适的地方。说到这里,还有一件非常搞笑的事情,当时搞不懂表单action的post和get方式的不同,所以根据字面意思我就理解为前者是向服务器发送数据,而后者是从服务器向客户端发送数据,而且还误人子弟,现在想来,真是有点愧疚,所以我对自己说:有不明白的地方就不要很确切的给别人说。通过这种方式以及在网上找资料学习,大约半年,经过自己的一点一滴的积累,终于写好了我的第1个asp网站。真的,刚开始学的时候确实有很多怀念的东西,因为什么东西都不会,也没有人来指点,所以只能在网上找资料,这也养成了我自学以及喜欢搜索的好习惯,印象最深的有一件事情,是朋友叫我写一个图片幻灯片,当时找了整整一个晚上,还算不错,找到了豪赌版本,有js的,flash的,vbscript的,最后选择了flash的,因为不需要改代码,只需要添加链接就可以了,但是当时朋友要求我一个页面要放好几个幻灯片,我就复制了一个幻灯片的代码然后粘贴,最后发现好像是错乱了,乱套了,后来查明原因是变量重复了,当时因为时间紧就没有自己重新写代码,于是我想到了另一个办法,每一个幻灯片作为一个框架,哎呀,这下问题解决了,不过就是选择整个幻灯片的时候位置出现了上下左右的浮动(我喜欢做好以后随便选择什么来随便点点或移动鼠标),反正是功能是实现了,总算在天亮之前可以睡个安稳觉了。
    去年暑假那个朋友看到很多网站都采用php,所以就老在我面前说改版,哎呀,我可头疼了,没学过啊。他说没事一边学一边做,于是我就在网上开始找资料,当然了:
    1.我要知道php是如何把内容发送到浏览器上的,经过查找,知道了通过echo这个函数来实现,后来逐渐发现有很多非常有用的函数如 sprintf blush ob_start等等函数,能达到很多特殊的效果。
    2.连接数据库,稍微知道web开发的人都知道php+mysql+apache的组合,所以选择mysql数据库就是我的首选了。我喜欢学一门语言首先找这个语言中的经典代码或程序,也忘了当时怎么找到discuz的,一下子就喜欢起来了,用的php连接数据库的类一直是它的,希望大家也喜欢,我也没有具体研究过用php本身自带的函数去连接数据库,有时间了测试下,呵呵 。
    3.asp的代码和html的代码是在一个文件中的,我当时就觉得非常不习惯,特别是当初只知道table tr td等等,不知道什么div css w3c,而且我编码喜欢缩进,自己看着喜欢,层次多了感觉非常不好,所以就在网上找相关资料,终于发现了一个php很有前途的东西:模板。一知道这个词,就在baidu里搜,哇,好多,最后我选择了smarty,原因是功能强大而且php官方本身就用的smarty。不过后来觉得这个东西比较麻烦,太大,而且对js代码需要加个代码才能实现,这个当时让我苦恼了好久,就是不知道测试正确的js如何运行不了。慢慢开始讨厌了,当然,discuz是我最喜欢的,所以我开始研究他的模板技术,哈哈,太高兴了,正合我意,一直用到现在。
    4.php+aphce+mysql的编码问题,这个问题开始的时候最让我苦恼了,我最先发现这个问题是以前asp的数据库导入到mysql里以后出现了乱码,还有后来接触到了ajax的protype框架,用gbk或gb2312是根本不能用的,在这里我只能提些意见,具体的操作就看各位的造化了,我建议所以编码采用utf-8码。
    5.w3c:这个东西是因为我讨厌table操作的麻烦而学习的,div+css+xml是我非常喜欢的,我希望大家也逐渐抛弃table吧,对了还有和js的结合,所以他们都要学好 。
    6.静态页面:根据我现在的理解,静态页面有两种,一种是伪静态页面,一种是实际存在的静态页面文件。我刚开始最后者不感冒,因为用apache的.htaccess文件就可以配置出相当灵活的伪静态页面,但是目前的情况,结合seo的发展趋势,后者是要着手研究了 。
    7.其他特殊的功能:比如大文件上传,单纯通过php是不能显示文件上传进度的,那么就涉及到和其他元素的结合,比如ajax,比如acticex,比如perl,比如applet,这些方法我都试过,虽然取得了比较有效的成绩,但是仍是我心头的一块石头。

今天先写到这里吧。呵呵

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

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

PHP Logging: Best Practices for PHP Log Analysis PHP Logging: Best Practices for PHP Log Analysis Mar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

HTTP Method Verification in Laravel HTTP Method Verification in Laravel Mar 05, 2025 pm 04:14 PM

Laravel simplifies HTTP verb handling in incoming requests, streamlining diverse operation management within your applications. The method() and isMethod() methods efficiently identify and validate request types. This feature is crucial for building

Discover File Downloads in Laravel with Storage::download Discover File Downloads in Laravel with Storage::download Mar 06, 2025 am 02:22 AM

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:

See all articles