Programming PHP
This book begins as most O'Reilly "Programming" books do: with a brief introductory chapter. In Programming PHP, this chapter is very short, so don't look to this book for a gentle introduction. On the other hand, this is the perfect book for you if you are just looking to learn a new scripting language. The following chapters go over syntax, data types, built-in functions, etc. These chapters are a little dry, but move quickly and effectively demonstrate the unique features of PHP (as compared to other scripting languages).
Of particular interest to programmers who are interested in expanding their horizons to developing dynamic web pages are the chapters on PHP web techniques, security, and application techniques. The web techniques chapter gives a quick overview of HTML and the GET and POST methods (and why you would want to use one or the other). It then covers a lot of useful tips and tricks that may be foreign to someone who has done little or no web development. Topics such as getting server information, form processing, sticky forms, file uploads, document expiration, and authentication are covered. It ends with an excellent discussion of maintaining state from page to page and visit to visit, covering cookies and PHP's (very cool) session support.
The security chapter covers standard things you want to keep in mind when creating dynamic HTML. No surprises here, but it is always good to be reminded. The application techniques chapter starts with a collection of best-practices, tips, and tricks to make your development process easier and better. It concludes with sections about error handling and performance tuning. As with the security chapter, there is nothing here a good programmer doesn't already know, but you can never hear it too many times.
I think this is a great book for programmers who want to start developing dynamic web sites with PHP. It gives a detailed overview of PHP, lots of valuable tips, and a good sense of PHP's strengths.
As someone who has written a lot of code, but only a little CGI, I really liked the chapters that discussed application development techniques specific to the web. Along those lines, not much time is spent on standard coding techniques, so if you want to use PHP but have never written any serious code, you may want to look elsewhere for an introduction. For the rest of you, just think, you may never have to use CGI.pm again.
The index seems adequate, although I must admit I did not use it much on the first read-through. The book is so well organized that, when reading it, you do not have to flip around much. Perhaps someone who has used this book as a reference can comment further on the quality of the index.
Contents are available on O'Reilly's page LinksSee Rasmus's page for links to where you can buy the book (maybe he gets a kickback for the link). Of course, you could always go to a local bookstore and purchase it.
You can purchase Programming PHP from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
PHP still doesn't have Remote Object calls correct?
Its pointless for all but smaller sites, businesses can't use it without remote calls.
www.cgisecurity.com/lib
Isn't this a contradiction:
This book provides good programmers who have never used PHP enough information to do serious web development using PHP
and
so if you want to use PHP but have never written any serious code, you may want to look elsewhere for an introduction
So is it good for newbies or not?
Most people would die sooner than think; in fact, they do.
It redefines the paradigm of online programming. Programming PHP, like PHP itself, marks a watershed in programming history. Generations from now technology historians will divide the time line into two periods: PPHP (Pre-PHP) and PPHP (Post-PHP). The PHP language, just like the book describing it, is beyond compare. Coupled together they have created a force for Good that rivals Superman, God and Scooby Doo all rolled into one. My next child is going to be named "PHP Programming Lastname".
This book provides good programmers who have never used PHP enough information to do serious web development using PHP
Those who are experienced with another language will find this book useful for picking up PHP.
so if you want to use PHP but have never written any serious code, you may want to look elsewhere for an introduction
..if, however, you don't have experience in any programming language, you'd be best to find a book that spends more time covering coding basics.
According to NetCraft, there are more PHP web sites than ASP.
http://twitter.com/onion2k
As a semi-competent Perl hacker I found PHP very easy to pick up, and I imagine the same would be true for anyone with some degree of coding experience. The only reference I find myself using regularly is the excellent PHP website which provides a pretty decent tutorial and a thorough and searchable command reference. Combine that with the fact that the manual is annotated by PHP users and the only reason for having a dead tree reference is to have something to read in the bath.
Still, buying it does at least give Rasmus some money...
"Are you being weird, or sarcastic?" said Emma. I said I didn't know because I get the two feelings mixed up.
This relevant
Are you kidding?
I work at a law firm full time, and that is all we use.
PHP is all I get requests for now, for outside work. (Actually less and less ASP crap, and no Cold Fusion)
"If you have done 6 impossible things this morning, why not round it off with breakfast at Milliways" -- hhgg
I have used it on 2 small commercial websites. Coupled with mysql development was quick and painless. I think it a good tool for throwing up websites quickly or for prototyping sites. I havent used this combination on a site that gets heavy traffic. I would love to know how it would hold up.
I like traffic lights
Read more about the babbler-in-chief at:
The White House
Thanks and have marijuana inspired day.
While I am sure that this is an excellent reference for PHP users, I'm sure I'm not the only one who thinks there is little point in buying a book on PHP when http://www.php.net/manual/ exists.
Though i'm not sure how they got those numbers it does show an interesting trend. PHP has been on the decline this year.
Also this doesn't relate well to other non-apache based tech's like ASP or ColdFusion.
-Jon
this is my sig.
and BSD is dying
I see ASP a hell of a lot more than I see PHP in my area.
The other day while I was waiting for a friend a Barnes and Noble, I picked it up only to put it back on the shelf ten minutes later. Usually I buy every Oreilly book for technologies that I use frequently, but I figured that there is probably very little in the book that PHP's excellent online documentation doesn't provide.
I could have sworn there was CORBA support (able to compile in CORBA support, anyway) but I can't find reference to it now. Has it gone?
creation science book
Continuing the tradition of well written O'Reilly 'Programming' books by those who know the language best[...]
:)
Bah! Anyone can also do that these days: http://www.ilbbs.com/oracovers
Netcraft knows nothing about intranets, which is where most real web development is done. I have yet to see a large company standardize on PHP, internally.
I've always found php.net to answer all of my questions very effectively. The online manual has everything a manual should, plus additional comments from users. The comments contain everything from hints about how to use a function to complete code samples. Many other programming languages could benefit from similar sites.
You have enemies? Good. That means you've stood up for something, sometime in your life. --Winston Churchill
Tell me about it. PHP is good if you are running a small MySQL-based webzine but if you're doing e-Commerce or anything database-intensive, as most high-volume sites show, use ASP, JSP, or precompiled-binaries (in the case of eBay's ISAPI interface).
ASP is for people who don't mind paying for a good programming environment.
That's very interesting... where approximately are you located? I'm in the Grand Rapids area myself, and all I can find as a web developer are asp gigs. I'd much rather use php and am generally interested in any area that would be looking for php developers,
Looking for Book Reviews? Check out Literary Escapism.
and help pay Rasmus for his PHP, which is pretty cool. He gave a great tutorial at our university and parked PHP development all over the place. I love Perl like Madonna loves dick, but PHP is a good tool to have in the carpenter's box for many one-off projects and tasks that simply don't require Perl.
Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
No, nothing has everything. On the other hand, "business" will do without almost anything as long as the task at hand gets done. PHP is not only excelent for business, it is wildly used in large e-commerce sites all over the world. Along with Perl, Python and Java servlets, it is one of the key web development technologies. It is very fast and very responsive. The lack of one or other feature may be a local problem, but it is not a general problem that allow you to classify it as "pointless"
Only inexperience makes one mix the "must have" column with the "nice to have" column. Or excessive press release reading. I have been using Java (Tomcat) and Python (by the way of Zope) in my recent projects, but I used PHP for years and it has always been adequate for small and large projects.
www.php.net/mysql_query
www.php.net/strftime
I've found this most useful: you only have to type a few more keys besides the function name to get the documentation, kind of like man pages.
Is a PHP reference book really neccesary? With the excellent webpage they have I just see a book becoming outdated too fast. The only useful one would be the pocket reference edition of this book which I have but still use seldom.
THIS SPACE FOR RENT
taking a bath/shower is not normal
Try a "Magic The Gathering" convention
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
I have also given a 'quickie' review about this book months ago on out little site. You can also find the thread on signalnine by clicking on the 'reader reviews' link, on the book information page.
spam, spam, spam, spam, e-mail, news and spam.
While I haven't read Programming PHP I found that PHP Pocket Reference, also put out by O'Reilly and written by Rasmus Lerdorf, was one of the worst books, and easilly the worst Pocket Reference, that I've every seen. The book is lacking information and content relative to the time that book was published. Function lists are incomplete and the descriptions are weak. With that said, you may want to think twice about purchasing the full sized book.
GeneralKael -- Slacker Extraordinaire
i love php, it's what i program in all the time
but this decision on their part baffles me. why would they wait so late in development to remove register_globals as an option that can be turned on. i imagine that many people won't update because of this. and the ones who do may find some scripts not working. it seems that they should have made this decision a while back.
i know you can still use $HTTP_*_VARS w/ it turned off, but scripts that are using $username and $password from forms are going to be screwed, barring a cheap loop at the beginning.
My other sig is an import.
ASP is for people who don't mind paying for a good programming environment.
Give me the unix programming environment before any version of Visual Studio.
It's been a while but last time I used IIS & ASP you couldn't even open a socket.
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
Support bookstores that protect their customers' privacy.
-Steve
There is no denying that the php.net/manual site is a good comprehensive resource. I do get tired of people suggesting to avoid books and just use the online manual. Obviously, they both have their places.
:)
The first strike against the online manual is that it's not portable. Downloading in most of the portable formats loses the user contributed comments, which are really what make the online version as helpful as it is in most cases. Seeing how other people have worked around issues, or just posted small extra example snippets is often a lifesaver.
However, where books can come in useful is the depth. The biggest drawback of MOST PHP books is that they are thin on detail - sometimes a 500 page PHP book has less than 200 pages of 'useful' content, and often times its still elaborated examples of basic 'form submission' code. 200+ pages of reprinting the manual is often not useful for too many people. Yes, it's portable, but I don't need pages of mSQL commands, for example, printed in any book.
The few good books I've seen regarding PHP that are more in depth and less 'manuals' include the new Professional PHP4 XML (not perfect, but certainly useful if you need to do XML, although that's a moving target in PHP), PHP 4 Web Applications (from New Riders, kinda thin, but many good techniques over and above the usual PHP stuff) and a couple others which escape me. Probably only 20% of the books published actually contain useful stuff you won't find by combing the manual or various discussion boards.
Also, in defense of books, some people just learn better by being able to read and see examples (which is why the books should have more good examples and fewer filler pages of manual reprinting). Similarly some people do better with hands-on training than with forums or books, which (small plug) my company provides (http://www.tapinternet.com/php/).
creation science book
You have probably never used PHP seriously, so you can be forgiven for your fast words. PHP is used in large commerce sites and large content sites all over the world.
Actually, ASP is for people who don't mind being locked in one operating platform, a problem PHP, Java , Python and Perl don't have. For your small projects it may not be an issue, but as projects grow bigger and more expensive, flexibility (pointedly cross-platform) quickly becomes a fundamental issue.
e-Commerce sites use ASP because they are developed by DBAs who are usually not programmers, but drag-and-droppers who understand control structures. It has nothing to do with the "intensity" of the work. Perl and Oracle are just as fast if you know what you are doing. Spank you very much, Trolly Trollerton.
Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
When I read your post, I thought of C++...
A complete hack of a language. It's cool and all, but by making the old calls available, you allow users to still shoot themselves in the foot.
At any rate, I always thought the point of a good programming language was to give me a good gun for hitting the type of target I'm after...but if I want to aim it at my foot, well, c'est la vie.
I can read a book while I'm sitting on the back balcony, in a relaxed position away from any keyboards (yes, some Slashdot readers do step away from the computing devices from time to time). I can very easily annotate the book with this thing called a highlighter. I can even make notes in it with a special "pen" device.
Don't give me the expense argument either. Forty or fifty bucks for a good computer book is like an investment in your future employability. For most of us, this book will cost less than we'll bill for an hour or two of work.
If you don't like computer reference books, that's fine, but realize that for some of us, they're quite handy and worth the money.
Read the EFF's Fair Use FAQ
I think you are under the impression the "dotcom" style of software life-cycle (develop today, throw away tomorrow) is the market standard.
Well, it is not. In the real software development world, you don't plan for the next year, you plan at least for the next five years (more, if you are really smart). Or have you not noticed the Y2K panic was mostly caused by 20-30 year old software still being used in production environments?
There many compeling reasons to take cross-platform capabilities into account. There are measured data showing somewhere up the scale it is cheaper to buy a very expensive Sun or IBM machine than keep throwing Intel hardware at a problem. There is also the corporate climate changes and technological advances to take into account. And I am not talking just about Microsoft licensing problems, but also about the forseeable Linux future.
All in all, dismissing the possibility of platform exchange is a risk most large projects prefer not to take, specially because it is more and more an easily avoidable risk.
Being the first edition, it does have some quirks to iron out which I have forwarded to the author. For example, it may talk about one alias to a function but not another, which would be helpful for Perl programmers and the like (for example, split is an alias to explode and join is an alias for implode). There were also a few issues with some of the functions in the book where they mixed up the argument order. Also I felt they didn't put near enough time into optimization, whereas the Perl book spends quite a few pages discussing it (I think the PHP one maybe had one page on it). There were some small things they skipped over which could make a difference in huge projects (when to use "" and when to use '') and whether to do print "$a$b$c" or print $a,$b,$c or print $a.$b.$c, etc. But overall this *is* the best PHP book I have read and I do look forward to their next edition.
//m
PHP is Perl on Crack! You didn't know that?
That said, I do have a gut feeling PHP is overcoming or overcame ASP.
It seems to me that web language books need to be split into two groups:
1. Web techniques
2. The language
Once one is familiar with typical web techniques and issues (form handling, state management issues, etc.), then many of the books seem redundant WRT web techniques.
The problem is that "Web Programming Techniques" would probably have to choose an actual language for its examples, so they figure they might as well put them together.
Perhaps Oreilly should split web language books into a language details book, and a "Web Techniques using X" series for those new to web issues (where X is a specific language). They could use pretty much the same material, but simply swap the language for that one.
Web programming issues are pretty much the same in ASP, PHP, ColdFusion, etc. If I need to pick up yet another web language, such as JSP, I don't want to waste book-size and eye-space on the same web issues, I want to get right into the specifics and uniqueness (gotcha's) of the particular language.
Table-ized A.I.
Could be slightly offtopic, but I want to make two points:
1) ASP is not IIS's version of PHP
2) ASP is not what most IIS development is in
opinion - ASP has the lowest learning curve of any web programming language
opinion - Most websites will not use ASP, even if they are using IIS on win2K. The site will create a COM object and give it control. ASP is a horrid environment for internet sites: it's interpreted and all variables are variants - even integers.
scary fact - There are no permissions to set in ASP. each page can execute anything that the server can. And if you're generating your SQL statements (rather than stored procs) based on user input it can easily be stolen and replaced with a drop all command.
So don't consider using asp, seriously - you get no gains whatsoever.
If you blog it...
I've programmed in both ASP and PHP, started out using ASP. I've been doing more and more PHP programming by choice recently due to the performance benefit I've seen by using PHP.
I converted my personal ASP site over to PHP some time ago and noticed that it ran MUCH faster using PHP, page loads were faster, DB queries we faster, etc...
Comparing them side-by-side on a Windows machine, I've still seen better performance out of PHP than ASP, even ASP server side components. Plus the ability to call both Java and COM objects on the same page makes it a no-brainer for web development. (especially how long it took VBScript to get regular expressions)
Now ASP.NET and JSP, that's a different story... but PHP kicks ASPs butt every time.
"For a successful technology, honesty must take precedence over public relations for nature cannot be fooled." -Feynman
So if you were going to learn one of the above, which would you choose? why?
Or am I comparing apples to oranges(and showing my ignorance)?
I am in the NC / SC area. Now in all fairness, I do talk some people into using PHP, but it isn't hard. I mean the benefits of not having to be Platform dependant is appealing to most (Cost is a big factor too).
I talked the Law firm that I work with into using PHP for our Intranet about 2 years ago (when we were doing a re-write) and we dumped ColdFusion. (I dont like having to pay for upgrades on the servers, although I know that the firm I am with could easily afford it)
Now, I have an Extranet, and Intranet, and our external site with PHP/ Mysql.
There is Web Devel work in my area, and a lot are receptive to PHP. No doubt.
It just makes better sense.
"If you have done 6 impossible things this morning, why not round it off with breakfast at Milliways" -- hhgg
So write one.
Why not fork?
A book that I found EXTREMELY useful was "PHP and MySQL Web Development" by Luke Welling and Laura Thomson. I had virtually no programming experience, but picked php up VERY quickly with this book. Its nice because it uses real world examples and shows you how to use php to interact with MySQL. This book looks great too, I'm gonna go pick it up.
---
Always standing, I am a tree awaiting the lightning. -Samael, Crown
I have really limited web experience but I have a simple need.
Basically, pdf files are generated in a directory. I need a user to be able to see all pdfs in that directory, be able to 'delete' the one he needs after he downloads it, and have the file really be deleted after 48 hours of being marked as for delete
I have *no* idea how to do this, but what little ive looked at says I need php
Would php be able to cover all of this, and if yes, would this book tell me how to do this?
Or should I learn another programing language first?
The ultimate network admin tool needs HELP!
since when do good programmers use php? is this new book a pop-up book with colorful pictures?
-richie
Hacking is the coding without thinking, without preliminary and formal analysis and design - what is the essence of real programming as a part of software engineering.
There is no such thing as Design or Analysis to apply or PHP hacking. You write the code and see what's happened. But even that part is terrible as there is no good debugging and logging.
Aspects (logical and UI) are not separated. It's same bad as ASP. And thus it has no future. It is as dead as ASP.
Unfortunately, there was a strong point about the budget in start-up web companies. They hired un-educated "programmers" who use such a "programming language". It was ok for small projects, such as few web pages. But the real project is far way from being a set of linked web-pages. That requires a real and general programming language, not just a scripting inside HTML tags.
No language - no programming. It is just a file format and therefore the PHP coding is just a hacking.
Less is more !
Universe is the successor to Satellite. It is a binding to the MICO CORBA ORB. See http://universe.2good.nu for details.
/. is irrelevant.
The site *I'm* working on right now doesn't have a single HTML tag in the code that does the "work" -- all the layout stuff is abstracted to an HTML rendering class (yes, I said "class", as in "objects and methods", as in "OOP", as in "real programming" -- whatever the hell *that* is), database access is abstracted to another class, and so on.
Tell you what: grab one of your "real" programming languages and write an object that generates dynamic PDF's. I need it today, bucko -- and don't forget the sales graphs (JPEG or PNG are OK) required for page 2. No, we don't have budget or time to go buy someone else's form tool, and besides -- WTF are we paying you so much $$ for if you can't do it in a few hours with freely available tools?
Conclusion: you don't know what you're talking about, a common affliction of self-described "experts".
Oh hang on.. I forgot.. PHP is just a Perl ripoff that has even less features.
Continue with your code.
mogorific carpentry experiments
As a professional PHP developer, I've found Web Application Development with PHP 4.0 to be one of the best books I've ever purchased. The authors, Tobias Ratschiller and Till Gerken, don't spens time and paper reprinting the manual. instead, they discuss the abstract concepts that distinguish a well-written webapp from a poorly-written one.
Coding conventions, organizing libraries, API design, and programming in a team environment are all discussed in depth. They include case studies and real-life examples of the concepts they cover.
To summarize, if you want a great discussion of PHP development that you *can't* get from the online manual, check this one out.
If you'd like to see a real-life example of distributed computing with PHP, take a look at the LiquidClassifieds/LiquidClassifiedsXML web service.
People always talk about how wonderful PHP's online documentation is. Its okay, and the section at the end with the gazillion functions is certainly comprehensive (and reminds me why PHP is not my first choice of programming environments).
However, I thought this book was *much* more intelligently organized. The section titles made sense. A was followed by B was followed by C. It spoke about good practice and design.
If this is what most people learned to program PHP with there whould be significantly less horrid PHP in the world. I think this is actually a return to the Oreilly golden era, away from poorly concieved fluff books like Essential Blogging.
Now if they could come up with a PHP (or Python, or Java) cookbook as good as the Perl cookbook, we would know that the good days were here again.
DBMS, like PostgreSQL.
Flat file dbms is no way to treat your customer(mysql)
;)
PHP is used for more than your "small" MySQL-based website. Not only does it support a lot other databases beside MySQL,
but it scales very good too.
As for ASP, a good programming enviroment?
*laff*
[alk]
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
http://sourceforge.net/projects/scoop
Scoop is a weblog script written in Perl with a MySQL backend. It is different then other weblogs, in that it allows the users to decide what stories get posted.
Aside from the PHP Programming book, I have to vouch for the PHP & mySQL Programming book... it's not the exact title.... the book is sitting there on my shelf... I'm just too lazy to turn around and read the title.
Anyway... I learned a LOT about PHP and mySQL and practical applications that are working out very nicely for my business. I was a total beginner at it, but it's given me a good reference source for future programming endeavours. Check it out!
I've seen the creator of PHP give a talk on more than one occasion about the history of PHP. Every time I heard this talk he would state the same thing: PHP is not a programming language.
Now here he is with a book titled "Programming PHP". Hmmmm...
--
The Homepage of Laurence Gonsalves