- Address Books & Journals
- Art & Architecture
- Audio CDs
- Audio Cassettes
- Biography
- Business & Finance
- Calendars
- Children's Books
- Comics & Graphic Novels
- Computers & Internet
- Crime, Thrillers & Mystery
- Education & Languages
- Fiction
- Food & Drink
- Gay & Lesbian
- Health, Family & Lifestyle
- History
- Home & Garden
- Humour
- Law Books
- Mind, Body & Spirit
- Music, Stage & Screen
- Photography
- Poetry, Drama & Criticism
- Reference
- Religion & Spirituality
- Romance
- Science & Nature
- Science Fiction & Fantasy
- Scientific, Technical & Medical
- Society, Politics & Philosophy
- Sports, Hobbies & Games
- Travel & Holiday
The reflection upon my situation and that of this army produces many an uneasy hour when all around me are wrapped in slepp.
Few people know the predica´ment we are in.
General George Washington, January 14,1776
Find more books about the year1776 and the American Revolution.

Author: David Sklar
ISBN: 0596005601
EAN: 9780596005603
368 Pages
Publisher: O'Reilly Media, Inc.
Binding: Paperback
Publication date: 2004-06-25
| shop | cond. | avail. | price | delivery costs | total | |
![]() | USED* | ![]() | starting at £2.40 | Buy now | ||
![]() | USED | ![]() | £ 2.75 | Buy now | ||
![]() | NEW | ![]() | £ 2.75 | Buy now | ||
![]() | NEW | ![]() | free on orders over £ 5 | Buy now | ||
![]() | NEW | ![]() | free on orders over £ 19 | Buy now | ||
![]() | NEW | ![]() | free on orders over £ 5 | Buy now | ||
![]() | NEW | ![]() | £ 2.35 | Buy now | ||
![]() | NEW | ![]() | free on orders over £ 20 | Buy now |
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.
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
last viewed books
|
|
|
||||||
|
|
|
Contact / About us
Bookmark this page
Home
Tell A Friend

























