Introduction
PHP5 is the latest incarnation of PHP (PHP: Hypertext Preprocessor)-a programming language devised by Rasmus Lerdorf in 1994 for building dynamic, interactive Web sites. Since then, it's been evolving into a full-fledged language in its own right, thanks to the hard work of all the people who contribute to its development.
A sure sign that PHP is maturing as a technology is evidenced by its totally revamped and upgraded support for object-oriented programming (OOP) principles and improved support for XML. The Zend engine (the part that interprets and executes PHP code) now enables PHP5 developers to implement, among a host of other things, graceful application-wide error handling.
With all the new features and functionality that PHP5 provides, it's important for programmers to "upgrade" their understanding in order to best make use of this powerful Web scripting tool. And that's why it's important for you, the reader, to invest your time learning about the latest and greatest that the people developing PHP5 have to offer.
That's all well and good, but what exactly is PHP?
You know it's a language for writing computer programs, so the real question is "What sort of programs can you write with it?" In technical terms, PHP's main use is as a cross-platform, HTML-embedded, server-side Web scripting language. Let's take a moment to examine these terms:
Cross-platform: Most PHP code can be processed without alteration on computers running many different operating systems. For example, a PHP script that runs on Linux generally also runs well on Windows.
HTML-embedded: PHP code can be written in files containing a mixture of PHP instructions and HTML code.
Server-side: The PHP programs are run on a server-specifically a Web server.
Web-scripting language: PHP programs run via a Web browser.
This means you'll write programs that mix PHP code and HTML, run them on a Web server, and access them from a Web browser that displays the result of your PHP processing by showing you the HTML returned by the Web server. In other words, you can make your programs available for other people to access across the Web, simply by placing them on a public Web server.
You're probably already familiar with HTML (HyperText Markup Language)-it's the main language used to create Web pages, combining plain text with special tags that tell browsers how to treat that text. HTML is used to describe how different elements in a Web page should be displayed, how pages should be linked, where to put images, and so on.
Pure HTML documents, for all their versatility, are little more than static arrangements of text and pictures, albeit nicely presented ones. However, most of the sites you find on the Web aren't static but dynamic, even interactive. They can show you a list of articles containing a particular word in which you're interested, show you the latest news, even greet you by name when you log on. They enable you to interact, and present you with different information according to the choices you make.
You can't build a Web site like that using raw HTML, and that's where PHP comes in. What sort of things can you do with it? Well, you can program sites that
- Present data from a wide variety of sources, such as databases, files, or even other Web pages.
- Incorporate interactive elements, such as search facilities, message boards, and straw polls.
- Enable the user to perform actions, such as sending e-mail or buying something.
In other words, PHP can be used to write the sort of sites that those who regularly use the Web are likely to encounter every day. From search engines to information portals to e-commerce sites, most major Web sites incorporate some or all of these sorts of programming. Among other things in the course of this book, you'll use PHP to build
- A simple, online text editor
- A Web-based e-mail application
- An object-oriented contact manager application
- An object-oriented logging agent
So, PHP5 can be used for a diverse range of applications, from simple utilities such as a text editor to powerful Web applications such as the logging agent case study. This book equips you with the knowledge necessary to build any kind of Web site you want using PHP5. You'll learn some useful techniques along the way and perhaps pick up some ideas that you can incorporate into your own Web sites and applications.
Web scripting is certainly the mainstay of PHP's success, but it's not the only way to use the language. Command line scripting-using CLI (Command Line Interface), which was introduced in PHP4-is one of many popular applications of PHP.
Why PHP?
One of the best things about PHP is the large number of Internet service providers (ISPs) and Web hosting companies that support it. Today there are hundreds of thousands of developers using PHP, and it's not surprising that there are so many, considering that several million sites are reported to have PHP installed.
You already know that PHP is a cross-platform technology and that once you've written your Web page, it's easy to get it up and running on our Web server, but how does PHP compare with other technologies out there? Well, comparing PHP with Perl is a bit tricky because they were designed for different things. PHP was specifically designed to rapidly create dynamic Web content; Perl was not. As a result, Perl can sometimes be a complicated language that can become prohibitive for users who want to create Web pages. Comparing PHP with ASP is a more balanced comparison, but then you have to pay for ASP, and ASP doesn't work well on a variety of platforms-it needs to be used on other proprietary platforms for which you also must pay.
You may ask, "Is there a downside to PHP?" In the past, PHP has been criticized for the way it handled a number of things-for example, one of its main stumbling blocks was the way in which it implemented object support. However, PHP5 has taken stock of the downfalls of its predecessors and, where necessary, has completely rewritten the way in which it implements its functionality. Now more than ever, PHP is a serious contender for large-scale enterprise developments as well as having a large, consolidated base of small- to medium-sized applications.
Where do I get help?
PHP is the most widely-used web scripting language, running on over 20 million web sites. For an open source technology that lacks any corporate funding whatsoever, its popularity may seem inexplicable. Yet PHP's success is no mystery; it has one of the most active and helpful online communities of any technology. Recent estimates place the number of PHP developers worldwide at around 500,000 and, given the nature of the medium, it's fair to assume that a large proportion are active online. In other words, for developers of PHP-based web sites, help is only ever a few clicks away.
Who Should Attend:
This course is aimed at people who wish to:
Improve their PHP skill level.
- Use PHP to interrogate MySQL databases
- Use PHP to maintain and update MySQL databases.
- Use MySQL as a data storage system on websites that require a sophisticated database facility.
Participants should have basic computer literacy, including the use of application software such as word-processors, spreadsheets and/or databases and understanding of the Internet. Prior familiarity with PHP is not required, but knowledge of elementary programming concepts such as storing of data in variables, data types, arrays, functions and control logic (if statements and loops) is mandatory as the course will assume familiarity with these concepts. Familiarity with elementary HTML is desirable.
Note:
The audience for this course is MCA, BCA, B.Sc(IT),M.Sc(IT),B.Sc,B.Tech or B.E(Any Branch),O Level, A Level
At Course Completion:
After completing this course, students will be able to:
Identify PHP syntax, Create PHP scripts, Send data to the Web browser, Create PHP scripts using multiple files ,Display and handle HTML forms within a single PHP script ,Send email from a PHP script, Normalize a database into First, Second and Third Normal Forms, Search a database using joins, groupings, and FULLTEXT searches, Create indexes to improve the ability to search a database, Modify specific scripts to allow for secure data transmission, Update database records using PHP scripts, Adjust behavior for server settings ,Paginate query results ,Make sortable displays ,Prevent forms from being submitted multiple times, Validate form data, Manage database encryption and decryption techniques, Describe the purpose of PEAR.
|