Book learning php 5 - Compare Prices and buy the Book



Title: Learning PHP 5
Author: David Sklar
ISBN: 0596005601
EAN: 9780596005603
368 Pages
Publisher: O'Reilly Media, Inc.
Binding: Paperback
Publication date: 2004-06-25


shopcond.avail.pricedelivery coststotal
USED*£ 3.38starting at £2.40£ 5.78Buy now
Used Book Learning PHP 5 bei Amazon Buy nowUSED£ 7.99£ 2.75£ 10.74Buy now
Book Learning PHP 5 new from BooksellerNEW£ 8.94£ 2.75£ 11.69Buy now
bookfellas - Buy NowNEW£ 15.71free on orders over £ 5£ 15.71Buy now
Book Learning PHP 5 on Amazon UK Buy nowNEW£ 13.62free on orders over £ 19£ 16.37Buy now
Compman - Buy NowNEW£ 15.71free on orders over £ 5£ 18.21Buy now
AnotherBookshop - Buy NowNEW£ 16.76£ 2.35£ 19.11Buy now
Blackwell - Buy NowNEW£ 20.95free on orders over £ 20£ 20.95Buy now

PHP has gained a following among non-technical web designers who need to add interactive aspects to their sites. Offering a gentle learning curve, PHP is an accessible yet powerful language for creating dynamic web pages. As its popularity has grown, PHP's basic feature set has become increasingly more sophisticated. Now PHP 5 boasts advanced features--such as new object-oriented capabilities and support for XML and Web Services--that will please even the most experienced web professionals while still remaining user-friendly enough for those with a lower tolerance for technical jargon.

If you've wanted to try your hand at PHP but haven't known where to start, then Learning PHP 5 is the book you need. If you've wanted to try your hand at PHP but haven't known where to start, then Learning PHP 5 is the book you need. With attention to both PHP 4 and the new PHP version 5, it provides everything from a explanation of how PHP works with your web server and web browser to the ins and outs of working with databases and HTML forms. Written by the co-author of the popular PHP Cookbook, this book is for intelligent (but not necessarily highly-technical) readers. Learning PHP 5 guides you through every aspect of the language you'll need to master for professional web programming results. This book provides a hands-on learning experience complete with exercises to make sure the lessons stick.

Learning PHP 5 covers the following topics, and more:

How PHP works with your web browser and web server
PHP language basics, including data, variables, logic and looping
Working with arrays and functions
Making web forms
Working with databases like MySQL
Remembering users with sessions
Parsing and generating XML
Debugging

Written by David Sklar, coauthor of the PHP Cookbook and an instructor in PHP, this book offers the ideal classroom learning experience whether you're in a classroom or on your own. From learning how to install PHP to designing database-backed web applications, Learning PHP 5 will guide you through every aspect of the language you'll need to master to achieve professional web programming results.

PHP has gained a following among non-technical web designers who need to add interactive aspects to their sites. Offering a gentle learning curve, PHP is an accessible yet powerful language for creating dynamic web pages. As its popularity has grown, PHP's basic feature set has become increasingly more sophisticated. Now PHP 5 boasts advanced features--such as new object-oriented capabilities and support for XML and Web Services--that will please even the most experienced web professionals while still remaining user-friendly enough for those with a lower tolerance for technical jargon. If you've wanted to try your hand at PHP but haven't known where to start, then Learning PHP 5 is the book you need. If you've wanted to try your hand at PHP but haven't known where to start, then Learning PHP 5 is the book you need. With attention to both PHP 4 and the new PHP version 5, it provides everything from a explanation of how PHP works with your web server and web browser to the ins and outs of working with databases and HTML forms. Written by the co-author of the popular PHP Cookbook, this book is for intelligent (but not necessarily highly-technical) readers.

Learning PHP 5 guides you through every aspect of the language you'll need to master for professional web programming results. This book provides a hands-on learning experience complete with exercises to make sure the lessons stick. Learning PHP 5 covers the following topics, and more: How PHP works with your web browser and web server PHP language basics, including data, variables, logic and looping Working with arrays and functions Making web forms Working with databases like MySQL Remembering users with sessions Parsing and generating XML Debugging Written by David Sklar, coauthor of the PHP Cookbook and an instructor in PHP, this book offers the ideal classroom learning experience whether you're in a classroom or on your own. From learning how to install PHP to designing database-backed web applications, Learning PHP 5 will guide you through every aspect of the language you'll need to master to achieve professional web programming results.

David Sklar is an independent consultant specializing in software development, strategic planning, and technical training. He was a co-founder and the Chief Technology Officer of Student.Com and TVGrid.Com. At both companies, David oversaw the architecture and development of varied systems to deliver personalized dynamic content to users around the world. After discovering PHP as a solution to his web programming needs in 1996, he created the PX (http://px.sklar.com/ ), which enables PHP users to exchange programs. Since then, he has continued to rely on PHP for personal and professional projects. He is the author of Essential PHP Tools (Apress) and the coauthor of PHP Cookbook (O'Reilly). When away from the computer, David eats mini-donuts, plays records, and likes to cook. He lives in New York City and has a degree in Computer Science from Yale University.
CHAPTER 8 - Remembering Users with Cookies and Sessions

A web server is a lot like a clerk at a busy deli full of pushy customers. The customers at the deli shout requests: "I want a half pound of corned beef!" and "Give me a pound of pastrami, sliced thin!" The clerk scurries around slicing and wrapping to satisfy the requests. Web clients electronically shout requests ("Give me /catalog/yak.php!" or "Here?s a form submission for you!"), and the server, with the PHP interpreter?s help, electronically scurries around constructing responses to satisfy the requests.

The clerk has an advantage that the web server doesn?t, though: a memory. She naturally ties together all the requests that come from a particular customer. The PHP interpreter and the web server can?t do that without some extra steps. That?s where cookies come in.

A cookie identifies a particular web client to the web server and to the PHP interpreter. Each time a web client makes a request, it sends the cookie along with the request. The interpreter reads the cookie and figures out that a particular request is coming from the same web client that made previous requests, which were accompanied by the same cookie.

If deli customers were faced with a memory-deprived clerk, they?d have to adopt the same strategy. Their requests for service would look like this:

"I'm customer 56 and I want a half-pound of corned beef."
"I'm customer 29 and I want three knishes."
"I'm customer 56 and I want two pounds of pastrami."
"I'm customer 77 and I'm returning this rye bread -- it's stale."
"I'm customer 29 and I want a salami."

The "I?m customer so-and-so" part of the requests is the cookie. It gives the clerk what she needs to be able to link a particular customer?s requests together.

A cookie has a name (such as "customer") and a value (such as "77" or "ronald"). "Working with Cookies," next, shows you how to work with individual cookies in your programs: setting them, reading them, and deleting them.

One cookie is best at keeping track of one piece of information. Often, you need to keep track of more about a user (such as the contents of their shopping cart). Using multiple cookies for this is cumbersome. PHP?s session capabilities solve this problem.

A session uses a cookie to distinguish users from each other and makes it easy to keep a temporary pile of data for each user on the server. This data persists across requests. On one request, you can add a variable to a user?s session (such as putting something into the shopping cart). On a subsequent request, you can retrieve what?s in the session (such as on the order checkout page when you need to list everything in the cart). Later in this chapter, "Activating Sessions" describes how to get started with sessions, and "Storing and Retrieving Information" provides the details on working with sessions.
Working with Cookies
To set a cookie, use the setcookie( ) function. This tells a web client to remember a cookie name and value and send them back to the server on subsequent requests. Example 8-1 sets a cookie named userid to value ralph.

Example 8-1. Setting a cookie
setcookie('userid','ralph');

To read a previously set cookie from your PHP program, use the $_COOKIE autoglobal array. Example 8-2 prints the value of the userid cookie.

Example 8-2. Printing a cookie value
print 'Hello, ' . $_COOKIE['userid'];

The value for a cookie that you provide to setcookie( ) can be a string or a number. It can?t be an array or more complicated data structure.

When you call setcookie( ), the response that the PHP interpreter generates to send back to the web client includes a special header that tells the web client about the new cookie. On subsequent requests, the web client sends that cookie name and value back to the server. This two-step conversation is illustrated in Figure 8-1.

Usually, you must call setcookie( ) before the page generates any output. This means that setcookie( ) must come before any print statements. It also means that there can?t be any text before the PHP

2008-06-10 This book is a must have if...

If you are coming from website development with html/xhtml and would like to move on learning php, this is the book to have.
It teaches you the very basic of programming from the very start with php so you have a solid foundation to keep building on.

I bought so many books where the writer just expected you to sit in front of a computer with the book somewhere between the keyboard and the mouse; This is not one of them, you can read this book on the train without having a computer in front of you as there are numerous examples and the result that would have been printed on the screen if you had done them.

At the end of the chapters, you also have exercises so you can learn by practice and monitor your progression (there you will need to be in front of your screen). The answers are at the end of the book.

similar books

PHP Cookbook (Cookbooks (O'Reilly)) PHP Cookbook (Cookbooks (O'Reilly))
Web Database Applications with PHP and MySQL Web Database Applications with PHP ...
Programming PHP Programming PHP
Essential PHP Security Essential PHP Security
PHP Pocket Reference PHP Pocket Reference
PHP and MySQL Web Development, 3rd Edition PHP and MySQL Web Development, 3rd ...
JavaScript: The Definitive Guide JavaScript: The Definitive Guide
HTML & XHTML: The Definitive Guide (Definitive Guides) HTML & XHTML: The Definitive Guide ...
Learning PHP & MySQL: Step-by-Step Guide to Creating Database-Driven Web Sites Learning PHP & MySQL: Step-by-Step ...
MySQL Pocket Reference: SQL Functions and Utilities (Pocket Reference (O'Reilly)) MySQL Pocket Reference: SQL Functio...

last viewed books

Workbook for Pharmacology: Concepts and Connections Workbook for Pharmacology: Concepts...
Beware of the Postman (Jack Russell, Dog Detective) (Jack Russell:Dog Detective) Beware of the Postman (Jack Russell...
Replay Replay
40-Day Journey with Madeleine L'Engle (40-Day Journey) 40-Day Journey with Madeleine L'Eng...
Tarantula Tarantula
V.R.I. Her Life and Empire. V.R.I. Her Life and Empire.