To realize a function in our group project, I have been learning php for several weeks. Most of the efforts are put into getting familiar with the syntax and some existing php appliances in order to facilitate my writing codes as soon as possible. But after I finished writing codes, I have no idea where to debug the codes. Till then have I realized how necessary it is to learn about the foundation of php, including where the php file is put, how php produce web pages and so on. Thus, I decide reorganize my knowledge about php and find out more about php than just some symbols and rules.
What is php?
Php is general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. From the definition, we know firstly that php is a scripting language, and secondly it produces dynamic web pages. The “dynamic web pages” here doesn’t mean the dynamic effects like flash or rolling credits. It suggests the web pages produced by using dynamic web techniques. The features of these web pages are that they are generally based on database techniques and they are dependent of the web servers, meaning that web pages are produced only when servers receive user’s requests. Thus, php is more alike programming languages like java and perl, and different from html because it produces static web pages. And we also get an idea that php will operate the database and compete with the task of user-server interaction.
How php works to produce dynamic web pages?
As JavaScript is a programming language embedded into web pages and executes within the user's web browser, PHP is a programming language which is embedded into web pages but executes on the server. The server receives a file’s request, recognizes the .php extension, and passes the file to the PHP engine for processing. The PHP engine will in turn examine this file, looking for PHP code to execute. The file may consist solely of PHP code, or the PHP code may be intertwined with HTML. The PHP engine will execute any PHP code, rendering any data into the page as determined by the code, and return the page to the server. Finally, the server will send this page and other related contents to the requesting browser, which will in turn render it in the same fashion as described in the first example. So in summary, PHP is just another tool which works in conjunction with languages such as HTML, CSS, and JavaScript to produce a web page.
To novices like us, it is not surprise to find that php is really friendly. We can owe this amenity to php’s merits. Firstly, unlike java or perl, the coding style of php is somewhat alike c language. And to learn its syntax is just such a fluent process, especially with the help of php learning websites like w3school and php100. Secondly, the combination of php and mysql is excellent for us. We can write external functions to indirectly operate databases. By this approach you can easily adjust your codes when databases are changed. Thirdly, the object oriented programming has been well planted in latter php versions, which greatly fits php to web programming. Finally, what interests us so much is php’ opensource. When we get a software written by php, we can either use it directly or do any change we want on the codes. There are thousands of finished php appliances, we can download them for free and realize some desirable functions without writing a line of code.
I know that java is an alternative to php and is been widely used in big company writing complex software and maintain big websites. It costs a lot, has higher security(not opensouce), and has higher efficiency when a program is processed in a big big team. But till now, php is quite enough for me. Besides, the function of php is getting stronger, because almost everyone can contribute to it. I believe in the future, all tools producing dynamic websites will lie in their functions and abilities. References:
http://en.wikipedia.org/wiki/Php http://developer.51cto.com/art/200901/107428.htm http://www.w3school.com.cn/php/
Share your knowledge and creativity with the world, protect your work with CC Licenses and discover other creative works and CC activities around the world. For Chinese CC, please go to: (中文版知识共享协议网站请点击) http://cn.creativecommons.org.
Creative Commons licenses provide a flexible range of protections and freedoms for authors, artists, and educators.
Toyhouse.cc is licensed under a Creative Commons Attribution-NoDerivs 3.0 Unported License.
© 2012 Created by Toyhouse Administrator.

You need to be a member of Toyhouse to add comments!
Join Toyhouse