Slashdot Mirror


PHP 5 Recipes

jsuda writes " With all the books being published recently about PHP a new one will need to find and fill a niche to distinguish itself. PHP 5 Recipes: A Problem-Solution Approach, published by Apress, has done so, in my view. This is an intermediate-level volume exploring PHP 5 using a recipe approach where the basics of PHP 5's functionality are expressed systematically but in a small-topic by small-topic manner. Cook-book style, each topic is relatively autonomous and can be individually selected, as necessary, for information or review, similarly to how many refer to the Joy of Cooking for help on a cooking project. It's a source for instant solutions to common PHP-related problems. There are over 200 such recipes presented." Read the rest of jsuda's review. Php 5 Recipes: A Problem-Solution Approach author Lee Babin, Nathan Good, Frank M. Kronman, Jon Stephens pages 646 publisher Apress rating 8 reviewer John Suda ISBN 1-59059-509-2 summary A problem solving approach to Php 5

Each of these recipes refers to a small element or aspect of PHP 5 and the presentations contain a brief overview of the topic, an explanation of how the code elements work, and where the code is applicable in projects. Overall, the book covers the whole range of PHP 5 functionality where each major element of PHP 5 is addressed in a recipe explaining and illuminating relevant code elements. You can easily get information about a specific PHP 5 element by going directly to the section of the book where it appears. Even better, the code snippets are designed to allow one to copy and paste them into your own applications or development easily and then to configure them as necessary. All of the code snippets are freely available for downloading at the publisher's website at www.apress.com.

There are 16 chapters and an index covering a total of 646 pages. The chapters are organized similarly to other PHP primers, covering the basic elements of PHP - data types, operations, arrays, strings, variables, files and directories, dates and times, functions, and regular expressions. The coverage for much of these concepts is relatively mundane and unoriginal. The discussion of dynamic imaging, however, is an exception. The writing throughout, however, is solid and clear. The book emphasizes the most important elements of new PHP 5. The object-oriented programming elements especially are covered - classes, objects, protected class variables, exception handling, interfaces, and the new mysqli database extension. The authors' discussions focus on PHP 5.0.4, MySQL 4.1, and cover Linux and Windows environments.

The book is directed at PHP programmers looking to learn the elements introduced by PHP 5, and for those looking to find fast solutions to coding problems. It assumes a basic knowledge of PHP. Many of the recipes discuss object-oriented programming and these are some of the more advanced sections of the book. I can say that Chapter 2, which introduces the object-oriented concepts is one of the better explanations of the topic that I've read. The chapter covers constructors, destructors, methods and properties, class diagrams and examples of these concepts at work in code snippets. There are a number of interesting segments containing custom coding of classes as reusable templates from which to create objects.

The book is well-designed and written. The discussion is clear and logical. The code snippets are well-explained. The authors are experienced programmers and developers, and Good and Stephens have authored or co-authored a number of technical books.

A large handful of the recipes contain projects, usually appearing at the end of the overview and presentation of code snippets covering the basics of the topics. The projects usually deal with the creation of higher-end classes and objects as solutions to common coding problems. The idea here is to show PHP 5 functionality at work providing useful code sections to be dropped into your custom applications. Chapter Five concludes with a sophisticated class dealing with dates and times issues. Other chapters contain constructions of string, file, graphics, and regular expression classes.

The last five chapters deal with using the PHP code in web applications and services. This material covers cookies (including construction of a cookie class), using HTTP headers, sessions, and using query strings. Much of this material has been covered elsewhere in the many primers on PHP already published. There is a chapter on using forms and an interesting chapter on working with markup. The better chapters are on using DOM to generate markup, parsing XML, using RSS feeds, SOAP, and simple XML. The chapter on mysql is basic, except for the section on creating a wrapper class. The last chapter deals with communicating with Internet services, like POP, iMap, and FTP. Another project presented here is one creating object-oriented code dealing with a mail class.

This is a useful book to have in a programmer's library."

You can purchase Php 5 Recipes: A Problem-Solution Approach from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

121 comments

  1. What about security? by CyricZ · · Score: 3, Insightful

    Do the examples show how to write solid, secure code?

    Indeed, inexperienced programmers writing insecure code has plagued PHP for years now. Far too many PHP books that I have flipped through show very poor style. They don't verify the inputted data, for instance, before making a SQL query.

    So while a professional, or even somebody with some level of experience, would see such an obvious problem, a beginner may not. And then the result is often a compromised server, a destroyed database, or some other shenanigans. Often times a problem with a user's PHP script ends up making other, completely innocent and unrelated projects (such as Apache or Linux) look to be at fault. That's not good for the image of the community.

    --
    Cyric Zndovzny at your service.
    1. Re:What about security? by NotoriousGOD · · Score: 2, Insightful

      Many PHP/MySQL texts don't cover the aspect of security, except for maybe a subtle reference to having HTTPS set up on your server. I have referenced many books in backend or database programming and there is very little on the subject. Maybe someone should publish a book regarding security itself. But it would still be true that this book would stand out among the existing ones, as covered by the post and my reasons above.

      --
      Where all think alike, no one thinks very much.
    2. Re:What about security? by AKAImBatman · · Score: 2, Funny

      But-but-but...

      Uncyclopedia says that PHP is super-secure! I read it online, it must be true!

      * Tongue planted firmly in cheek

    3. Re:What about security? by JabberWokky · · Score: 2, Insightful
      I'd imagine that most bridges, dams and skyscrapers built by inexperienced or non-formally educated engineers would be pretty lousy.

      The problem is that it's illegal to have a non certified engineer working on a project that can impact others. Those engineers are expensive because you're paying for their recognized skills and the years it took them to obtain them.

      Meanwhile, 15 year olds are bidding on software projects and it's seen as a great opportunity. There are certainly some benefits to the industry being willing to hire self-trained and inexperienced programmers, but those inexperienced programmers are being handed even mission critical projects.

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    4. Re:What about security? by merreborn · · Score: 1, Interesting

      I've noticed you post a very similar PHP security troll on every PHP thread.

      I have to ask -- do you also point out C++'s flaws, in the realm of buffer overflows? It is, after all, an inherently insecure language.

      Which languages do you consider secure? Java?

    5. Re:What about security? by TheTomcat · · Score: 2, Informative

      There have been a couple recent PHP Security books.

      Yes, I am affiliated with the publisher of the book I linked--but it's a good book! (-:

      S

    6. Re:What about security? by CyricZ · · Score: 0, Troll

      You call it a "troll", I call it pointing out weaknesses with PHP's design and implementation. I'd rather those problems be acknowledged, rather than brushed under the carpet. After all, that's what true engineering is all about: knowing how your design is insufficient, and knowing how to properly deal with such issues.

      It's widely acknowledged that C++ suffers from various security problems. Anyone who has any level of formal training or experience knows that. Not only that, they know how to avoid such problems. The use of a garbage collector, the STL string class, and so forth can go a long way towards avoiding security issues.

      Of course, if you want to write truly solid code it's best to use languages like Haskell or Standard ML, amongst others. Then you can formally verify your implementation, in addition to avoiding the problems that many other languages suffer from.

      --
      Cyric Zndovzny at your service.
    7. Re:What about security? by fishybell · · Score: 1

      Just because it's been said a million times before does not make the statement less valid. Nor is a discussion on potential security holes in C++ invalid either.

      --
      ><));>
    8. Re:What about security? by Anonymous Coward · · Score: 0

      There are a few books on PHP security, one of which has a nice web site and code repository:

      Essential PHP Security

    9. Re:What about security? by kuzb · · Score: 1

      The statement is invalid when nothing is provided to back it up. He runs around screaming that PHP is going to kill your dog, and then doesn't tell you why.

      --
      BeauHD. Worst editor since kdawson.
    10. Re:What about security? by Moderatbastard · · Score: 0

      It's not plagiarising if you name your source. Insightful my ass.

      --
      1/3 of jokes get modded OT. If you get the joke, mod 1 in 3 insightful/interesting/underrated to restore karma balance.
    11. Re:What about security? by ooh456 · · Score: 1

      Thanks for calling this troll a troll. You should modded up to 7. He must be another ASP/PERL/JAVA programmer who is upset because of the mass exodus towards PHP. If anything about PHP needs a rant... it's not form security its Magic Quotes. Lose them, I say.

    12. Re:What about security? by Anonymous Coward · · Score: 0

      If it's said a million times, chances are I'll punch you in the fucking throat for being obnoxious: valid statements or not.

    13. Re:What about security? by FST777 · · Score: 1

      The answer is quite simple: let everyone use the docs at php.net and think for themselves. An experienced computer user (all other beings shouldn't program anyway, not even in a scripting language like PHP) will realize the security consequences involved.

      This might sound elite, but this is how I did. I used a book to learn the basics of SQL and I'm now teaching myself to use other ways to get rid of the security and efficiency issues I keep programming in MySQL-routines because of that dreaded book. I learned PHP using just the docs on php.net and I'm quite confident that I'm both efficient and secure in all my PHP-routines.

      (all my boss ever wanted is that I would comment my scripts to 'easily replace' me 'when necessary'. I still don't quite get it ;-) )

      --
      Free beer is never free as in speech. Free speech is always free as in beer.
    14. Re:What about security? by metallic · · Score: 1

      There's no such thing as a security hole in a language. If a security hole crops up in a piece of software, the blame falls squarely on the programmer. The only thing a programming language can try to do is include features that will encourage good programming practices.

      --
      Karma: Positive. Mostly effected by cowbell.
    15. Re:What about security? by Anonymous Coward · · Score: 0

      I call you a troll on crack.

    16. Re:What about security? by bani · · Score: 1

      Many PHP/MySQL texts don't cover the aspect of security

      You say this like PHP is the sole exception. But it isn't.

      Most perl, python, ruby, C/C++, ObjC, Haskell, Lisp, Tcl, ML, Lua texts don't cover security either.

      Maybe someone should publish a book regarding security itself.

      You mean like this?

    17. Re:What about security? by bani · · Score: 1

      I've noticed that too.

      He keeps ranting about PHP like PHP is the sole exception from of the vast ocean of languages out there.

      A more intelligent discussion would point out that security in general does not seem to be a priority, regardless of the language. (Maybe one could count java as the sole exception here, even though its record hasn't been stellar either.)

      But this is way over cyricz's head. Like a freebsd zealot who bashes linux at every chance, he bashes PHP at every chance. In the end he comes off sounding as hip and trendy as a 11 year old ranting about how his atari is better than your commodore 64.

    18. Re:What about security? by Anonymous Coward · · Score: 0

      Many PHP/MySQL texts don't cover the aspect of security

                You say this like PHP is the sole exception. But it isn't.

      No doubt it's more than an education issue. PHP has simply proven itself to be inherently more error prone with regards to security than other alternatives, in large part due to the slipshod appliction architecture it promotes. You get the same effect with crappy, single-tier applications developed with other tools.

    19. Re:What about security? by Anonymous Coward · · Score: 0

      what do you recommend then?

  2. Really :o by JonN · · Score: 2, Funny

    Am I finally going to learn how to display "Hello World!"?

    --
    do.what.promptcmds
    1. Re:Really :o by 1110110001 · · Score: 1

      "Hello World" is already the code for displaying "Hello World" in PHP =)

      b4n

  3. Does it tell you how to upgrade PHP? by Anonymous Coward · · Score: 1, Interesting

    Due to the constant vulnerability announcements and lack of RedHat legacy rpm support, we've been removing PHP from all our webservers.

    1. Re:Does it tell you how to upgrade PHP? by Bandman · · Score: 1

      I wouldn't think that upgrading PHP (compiled from source, mind you) would be all that difficult.

      As for RPMs....no idea. I don't use them.

    2. Re:Does it tell you how to upgrade PHP? by Anonymous Coward · · Score: 0

      Thanks for bringing nothing to the table! Hope you can continue doing so in the forseeable future!

    3. Re:Does it tell you how to upgrade PHP? by CyricZ · · Score: 0, Flamebait

      Perhaps the constant vulnerability issues with PHP, and also with the many applications built upon it, should tell you that it's not a suitable option for serious work.

      For smaller sites, there are Ruby and Python-based solutions that often work far better, and are far more secure.

      And the options for larger scale development are quite well know, as well.

      --
      Cyric Zndovzny at your service.
    4. Re:Does it tell you how to upgrade PHP? by Anonymous Coward · · Score: 0
    5. Re:Does it tell you how to upgrade PHP? by malchus842 · · Score: 1

      Download and build apache and php from source. Remove the RPM versions. Install the newly built ones. Now you are no longer tied to the RPM that RedHat provides. I don't even bother installing RPM's for apache, php, perl, sendmail (and other packages) at this point.

      This way, I get to control what version and what patches I run, on my schedule.

      You can get the source for php from php.net and the source for apache from apache.org. It's really that easy. Or you can pay an apache/php geek to do the first one for you, then take over yourself.

    6. Re:Does it tell you how to upgrade PHP? by houseofzeus · · Score: 1

      That's kind of slack. However you might be interested to know that the PHP source packages contain a makerpm script. They are hells out of date however and needed quite a bit of tweaking to get going.

      I have a set of PHP 4.4.1 RPMs for FC1 available here:

      http://houseofzeus.com/notblog/?postid=322

      The SRPM is also there, so if you need another variant of PHP compiled then you can get to the SPEC file I modified and change it appropriately :)

    7. Re:Does it tell you how to upgrade PHP? by Fyre2012 · · Score: 0

      he certainly brought something to the table

      in case you missed it, he pointed out that there are other package managers to use.
      i prefer apt-get personally. Emerge is ok, but the same commands with rpm just comes off ugly and unnatural

      apt-get install $packagename
      rpm -Uvh ./path/to/package/$packagename.rpm


      imho, apt-get is like butter, where rpm feels more like a hammer

      --
      This is not the greatest .sig in the world, no. This is just a tribute.
    8. Re:Does it tell you how to upgrade PHP? by houseofzeus · · Score: 1

      Apples to oranges. The redhat equivalent to apt-get is yum these days:

      yum install $packagename

      You can set redhat distros up to use apt however (though I see no reason to).

  4. Re:Really :o yup by RalphSleigh · · Score: 1

    Maybe...

    --
    Come as you are, do what you must, be who you will.
  5. Does it delve into SQL? by CyricZ · · Score: 2, Insightful

    Many PHP books I've seen often include an SQL tutorial. Due to space constrains, it is often quite lacking and only focuses on using SQL, rather than designing efficient and well-planned databases. Such half-assed tutorials may often be very misleading to new PHP users.

    I recall working with one web developer who learned PHP from such a book. We told him that we wanted to use PostgreSQL as the backend for our site, but he insisted on using MySQL, since that was the only system mentioned in the book he had bought. We no longer required his services after that show of incompetence.

    Does this book try to cover topics such as SQL and database design, which should be covered in their own, separate book(s)? Does it specifically refer readers interested in such subjects to consult other sources of information?

    --
    Cyric Zndovzny at your service.
    1. Re:Does it delve into SQL? by Versalis · · Score: 1
      No, it does not take an indepth look at MySQL database design. It only explains how to interact with an existing MySQL instance.

      I have to say, I disagree with the importance you place on this in a PHP book. If a person needs to know more about MySQL then they should get a book on MySQL. This book also has examples of connecting to an FTP server - should it also go into the proper way to setup an FTP server? And creating clean HTML code? Optimizing Apache? Sendmail? If it did that it would no longer be a 600+ page book on PHP but rather a 10,000+ page library on the entire world of computing.

    2. Re:Does it delve into SQL? by CyricZ · · Score: 1

      You misunderstand my stance. We seem to be in agreement.

      Indeed, I wanted to know if this book covers SQL just because if it were a good book, it would not cover topics such as SQL and databases. Those topics are best covered by experts writing their own books on such subjects. This book should at least recommend that interested readers consult other material to learn more about such subjects.

      It would be a major blemish on this book if it did cover such topics.

      --
      Cyric Zndovzny at your service.
    3. Re:Does it delve into SQL? by Versalis · · Score: 1
      Ah, I misunderstood. Forget I said anything.

      No, it does not reference other books. It only tells you how to work with an existing table.

    4. Re:Does it delve into SQL? by Anonymous Coward · · Score: 0

      Since SQL is a different language altogether, as well the fact that database structure and implimentation is pretty involved, I doub't that they will get much into more than simple insert and select statements.

      Maybe you should look into getting something more specific to SQL instead of trying to kill 50 birds with a small twig.

      Doubt if the book even goes over PHP completely, so what you are looking for will likely have to be goten in another book.

  6. PHP... by Anonymous Coward · · Score: 0

    Too bad PHP is so popular, pulling work away from languages that are well-designed. Argh. Too bad it costs more to get Python or Ruby hosting, and one cannot even hardly find Scheme hosts.

  7. Re:Does the book also cover the fact by Anonymous Coward · · Score: 1, Informative

    This is not flamebait. It is poorly designed, hackish and is continually mutating I would like to see someone argue that it's not all or any of these points. PHP is popular because it's easy to jump into and fairly easy to learn, not because it's an efficient stable development platform. PHP also has a history of security problems almost as long as Microsoft.

  8. May I sugest a great PHP tutorial? by PromptZero · · Score: 2, Informative

    I learned PHP using Kevin Yanks tutorials and articles 4 years ago. His books and tutorials are very easy to understand and use. His tutorials and articles can be read on http://sitepoint.com/

    1. Re:May I sugest a great PHP tutorial? by CyricZ · · Score: 2, Insightful

      How recently have his articles been updated? Indeed, there have been some preliminary security developments within the past four years.

      Nothing could be worse than a new PHP user learning PHP from outdated tutorials which fail to show the proper techniques necessary for building solid, secure and trusted web applications.

      --
      Cyric Zndovzny at your service.
  9. Re:beasters by Anonymous Coward · · Score: 2, Funny

    OMG why cant evryone juSt use teh Rubby on Raylls lol its teh fastest and generall bestest web-framewrok avaleabal. u can even use teh AJXA with it!!!!!1!

  10. Re:Does the book also cover the fact by CyricZ · · Score: 2, Interesting

    PHP is popular because it's easy to jump into and fairly easy to learn, not because it's an efficient stable development platform. PHP also has a history of security problems almost as long as Microsoft.

    Indeed. A truer statement has rarely been stated.

    From an engineering standpoint, PHP is abysmal. Many people will suggest otherwise, but they are often those who lack a formal education and background in designing secure, scalable, high-reliability software systems.

    The Hardened-PHP project is a perfect example of what is wrong with PHP. It's not that the Hardened-PHP project itself is bad (it's a very good thing!). The problem is that the core PHP developers have not taken such basic security concerns into consideration. The fact that they have to rely on a third party to provide such integral and necessary functionality is a very bad sign.

    --
    Cyric Zndovzny at your service.
  11. Re:More of a community attitude issue. by NotoriousGOD · · Score: 0

    Well due to the numerous open-sourced products, the fact that Apache is free and it being a relatively (stress on this word) easy language, means that until it's replaced it will only become more popular. So good security practices need to be stressed and gone over in detail by someone. Otherwise how can people learn about it?

    --
    Where all think alike, no one thinks very much.
  12. First non-italicized post by MBraynard · · Score: 3, Funny

    Maybe /. can do a review of 'CLOSED TAGS FOR DUMMIES' next.

  13. Unclosed italics tag by tradiuz · · Score: 1, Redundant

    Someone has an unclosed italics tag somewhere...

    Look, I fixed it!

    1. Re:Unclosed italics tag by op12 · · Score: 1

      Actually, looking at the code it's an unclosed tag at the end of the review.

    2. Re:Unclosed italics tag by Shai-kun · · Score: 1

      In Internet Explorer, you didn't fix it.
      In Firefox, there's no problem to begin with. :-P

      --
      ...or so I've been told.
  14. Catalyst by Ktistec+Machine · · Score: 1

    I'd like to see more distributions include Catalyst. I think Mandrake is the only one that does, now. If MVC frameworks like Catalyst were more universally available (as PHP is now) they'd get a lot more use.

    1. Re:Catalyst by CyricZ · · Score: 1

      Writing an article may help with that.

      If you can present a good case why people should move away from PHP towards alternative systems, then it might lead to some other distributions including far superior systems. Indeed, the best way to get this sort of a change is to raise awareness, and a well-publicized article may just do the trick.

      I would imagine that there is a big enough community of serious web developers who are fed up with the insecurity and lack of quality that PHP poses. They might be able to offer the clout necessary to get PHP removed from mainstream distributions, and better alternatives added in its place.

      --
      Cyric Zndovzny at your service.
    2. Re:Catalyst by Anonymous Coward · · Score: 0

      I think what's needed (or was needed before PHP metastasized into the tumor it is today) is a mod_perl_lite, something that doesn't try and expose so much apache functionality that hosting companies are afraid to run it. Also it should properly protect one site's code from another. Maybe mod_perl2 has some of these features as options...

  15. Re:An anti-PHP coalition? by Anonymous Coward · · Score: 0

    ASP called, it want its Holy War back...

  16. An anti-PHP/anti-ASP coalition. by CyricZ · · Score: 1, Insightful

    An anti-PHP/anti-ASP coalition would be even better than separate anti-PHP and anti-ASP coalitions.

    Either way, the fact remains that insecure, faulty systems are used far too often for web development. The best thing that can be done at this point is to raise awareness as to the flaws and problems associated with such systems. That may be the most effective way to eradicate their use, thus providing a far more secure Internet.

    --
    Cyric Zndovzny at your service.
    1. Re:An anti-PHP/anti-ASP coalition. by BearCave · · Score: 0

      It is all very well and good to tell everyone not to use someting and that if you were an expert you would know better.

      Do you really want everyone to pay highly qualified experts to build basic websites?

      People use what they can, why not recmend something better instead of blowing smoke?

  17. Legacy products by Anonymous Coward · · Score: 0

    It's hard to move them off PHP. The majority don't even use it, it only exists because it was included in the standard build (not my decision).

  18. Dangit! by Plaid+Phantom · · Score: 1

    Now I'm hungry again!

    --
    All comments are properties and trademarks of the voices in my head. Not like I'm gonna claim them.
  19. Re:Does the book also cover the fact by aint · · Score: 1

    A version of the Hardened PHP patch will [most likely] exist in PHP (by default) as of PHP 6.0.0.

  20. Re:Does the book also cover the fact by CyricZ · · Score: 0, Redundant

    The fact that it will take them up until version 6.0 to include such essential and basic security functionality shows their lack of quality. For serious applications, that is just plain unacceptable.

    --
    Cyric Zndovzny at your service.
  21. Developer's Union? by mcrbids · · Score: 2, Interesting

    The term "Engineer" is, in most contexts, a priviledged term. Not just anybody can be labelled an "Engineer" until they've gone through some rigor.

    Why not apply this idea to software? If there was a coalition or Union of workers, with a commonly agreed-upon set of requirements and certifications, with annual fees and a good reason to require a decent demonstration of competence? Something with real teeth, and ongoing certification requirements. Think, the Bar, only for software engineers instead of Attorneys. As with Real Estate, being a "Realtor" is a priviledged term.

    If done right, it would be AWESOME to mention on a resume, and would likely become something like the Underwriter's Laboratories - a private entity, but one that's almost required by law simply because it's a reasonable assurance of safety.

    There are a number of VENDOR certifications (EG: CCNE, RHCE, and the laughable MCSE, etc) but is there any platform-neutral, "This guy knows how to validate input and write qualifiable code" organization?

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
    1. Re:Developer's Union? by lewp · · Score: 2, Insightful

      Because companies would have to spend a whole lot more money to get those people. They're not going to do that unless the consumer demands it. The consumer isn't going to demand it unless the certification/standard/seal of approval becomes well known. And that isn't going to happen unless someone spends a large amount of money creating and marketing it.

      Basically, the industry would have to foot the bill for something that would end up costing them a lot of money in the long run with nothing to gain except stable software. Of course, software companies nowadays make tons of cash off selling what amounts to bugfixes for their previous products, so there's more money down the tubes. I guess it could be done in a grassroots fashion, but you have to remember that what you're suggesting would essentially call most of the people working in the industry "unqualified". Doubt they're going to go for it.

      In short, this isn't going to happen. Not anytime soon, at least. Definitely not until consumers learn to stop taking it up the keister and stop buying software that doesn't work just because they don't know any better.

      Not that I'm jaded...

      --
      Game... blouses.
    2. Re:Developer's Union? by IAmTheDave · · Score: 2, Insightful
      Because companies would have to spend a whole lot more money to get those people.

      As far as I'm aware, developers are pretty well paid in the overall job market, more than twice as much as teachers in many cases.

      I did spend time getting degrees in CS and CE, and it would be nice to seperate myself from those who simply have MSP on their resume. But wait - that's right - I DO seperate myself, by putting my CS and CE degrees on my resume.

      Rarely is software life threatening (yeah, I know, there are examples) but hospitals rarely bid out to teenagers to build their software. The reason so much engineering (bridges, homes) requires such certifications is because a collapsing bridge is a bit more of a problem then a buggy PHP website. So if company A wants to hire Joe Teenager to build their website, well, so be it.

      I get hired because of my degrees and years of experience, and while I do write some web code, most of my time is spent on more valued tasks, like writing mission critical software that drives the businesses I'm in - and I get paid more than Joe Teenager gets paid to build the website, because of those abilities.

      Rarely, if ever, have I heard some 20 year old non-college educated designer/developer called an engineer.

      --
      Excuse my speling.
      Making The Bar Project
    3. Re:Developer's Union? by mcrbids · · Score: 1

      I did spend time getting degrees in CS and CE, and it would be nice to seperate myself from those who simply have MSP on their resume. But wait - that's right - I DO seperate myself, by putting my CS and CE degrees on my resume.

      Really? The underlying POINT at this poing in the thread is that there's not enough differentiation. And, truthfully, I've seen an incredible amount of shoddy, negative-worth work done by highly credentialled, CS/CE developers!

      Somebody with a CS/CE degree is going to do better at developing software than the average joe, I'll grant that easily. And, I'd grant that it's probably more likely that somebody with the CS/CE is going to do a better job than somebody that's self taught. But, there's certainly no assurance that it will be any better at all.

      Combine the Better Business Bureau, the Bar, and the Association of Realtors, and you have pretty much captured my idea...

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    4. Re:Developer's Union? by IAmTheDave · · Score: 1
      Combine the Better Business Bureau, the Bar, and the Association of Realtors, and you have pretty much captured my idea...

      Unless sarcasm was your goal, barring the BBB, the Bar and the Association of Realtors is hardly a group that guarentees any sort of quality. There are some crappy lawyers out there (Harvey Birdman and Lionel Hutz come to mind, but I digress, because it makes it seem like I'm trying to be funny) and some really crappy/corrupt realtors out there.

      Just because someone passed the bar doesn't make them a good lawyer. For instance, Delaware is one of the hardest bar exams to pass in the country, with its next door neighbor, NJ, being one of the easiest. I know some people that can't pass Delaware and slept through the NJ bar exam. (Although, in this "tri-state area", not passing all three - including Pennsylvania, makes it harder to get a job...)

      And so my point is, these shoddy developers with CS/CE degrees are pretty equal to the shoddy lawyers who passed a bar - I don't know what school they went to, but the one I attended did not make passing easy. Any implication that getting a CS degree should be easier comes from someone that did not attend the same college I did.

      --
      Excuse my speling.
      Making The Bar Project
  22. Re:Does the book also cover the fact by Anonymous Coward · · Score: 0

    Why do you have such a hard-on for php? Did it kick your dog?

  23. seasoned php programmers by Inopia_Aardbei · · Score: 0, Troll

    PHP, isn't that like the betamax of scripting languages?

    1. Re:seasoned php programmers by kuzb · · Score: 1

      Did you know some professional film makers still use Betamax because it has superior image quality to the VHS format? If you're trying to flame PHP, you picked a really bad way to do it.

      --
      BeauHD. Worst editor since kdawson.
    2. Re:seasoned php programmers by Inopia_Aardbei · · Score: 1

      Every technology has its niche market. Betamax (and v2000 with it) died because it failed to produce tapes longer than 1 hour in the early days, making it unsuitable for movie rental purposes. My point was just that PHP was a great technology when it was just released (like betamax was), but has long since been replaced by both better implementations of the same idea, and completely new approaches. People who still use it usually do so either because of legacy, or because they haven't investigated the alternatives. ps: pepper this comment with imho and smilies until you consider it an opinion instead of flamebait

    3. Re:seasoned php programmers by StarkRG · · Score: 1

      If you mean that it's superior in every aspect but didn't get enough hype and eventually phased out? Then no, it got plenty of hype...

    4. Re:seasoned php programmers by Anonymous Coward · · Score: 0

      People use Betacam. Betamax is dead as a doornail. And no professional video guy uses VHS, anyway - possibly SVHS, if you absolutely have to stick with analog in this day and age.

    5. Re:seasoned php programmers by Insensitive_Claudio · · Score: 1

      No, professional film makers use Betacam (and Betacam SP). The only things similar is the tape size. Betamax is a consumer level product that is technically very similar to VHS.

  24. Does php work in old browsers? by Anonymous Coward · · Score: 0

    Thanks!

  25. Affiliate Program? by Thrakkerzog · · Score: 1

    Does B&N have an affiliate program? Looking at the purchase link, I see it passing an encoded userid.

    I'm just wondering if someone is trying to make a buck off of this.

    1. Re:Affiliate Program? by VP · · Score: 2, Informative

      Yes, Slashdot gets referral credit for all books reviewed. This is not a secret, and is probably in a FAQ somewhere. By using the link in the article, you are supporting Slashdot, but no one is making you use that link.

    2. Re:Affiliate Program? by Thrakkerzog · · Score: 1

      Thanks for the info!

  26. ebook by smoker2 · · Score: 1
    This title is available as an ebook.

    There is allegedly at least a 50% discount for the ebook as against the printed version, although the price of $22.50 means there is a nad less than a 50% discount from the full $44.99.

    I guess publishers don't have to know maths, or they are just tight. That whole half cent makes their statement a lie..

    Maybe they meant up to 50% discount.

  27. Re:A lack of security-wise individuals. by Anonymous Coward · · Score: 0

    Have a look at the PHP Security Consortium publications. PHP can be secure it's not got the same emphasis like lets say Java but thats one of the advnatges of PHP quick, fast and not restrictive.

  28. Re:An anti-PHP coalition? by kuzb · · Score: 2, Insightful

    That has to be the worst argument I've ever seen. PHP doesn't pose many security problems, and those that it did does pose get fixed rapidly. The 'security risks' you see are due to 1) improper system administration and 2) badly written user code - neither of which can be blamed on PHP.

    Your argument is goes something like this: "Because someone stabbed somoene else with a fork, we should rally together and make sure forks are banned from all households". You may as well form an anti-C coalition while you're at it, because there are a lot of insecure C applications out there. Perhaps we can get GCC removed from distrobutions as well.

    --
    BeauHD. Worst editor since kdawson.
  29. Re:Does the book also cover the fact by kuzb · · Score: 1

    Perhaps you could outline some of these flaws in detail? You seem to think you know what you're talking about, but I have some serious doubts.

    You sorta of come off as a disgruntled Perl programmer who had his job displaced by another language.

    --
    BeauHD. Worst editor since kdawson.
  30. Let the web language wars begin!!! by Sir_Cockalot · · Score: 1

    I've never seen so many people bag on a web scripting language. Perhaps there should be a whole discussion board dedicated to your web language of choice whether is Pearl, JSP/JAVA, PHP. ASP, .NET or ColdFusion.

    I've heard great things and bad things about all of them. Pearl is hard to learn, but is super fast and secure. Java is super slow and hard to learn, but very secure. PHP is easy to learn moderately fast, but insecure. ASP is fast, but is being replaced by .NET. .Net is fast and easy, but you're stuck with Microsoft and it can be very browser specfic. ColdFusion is slow, but super easy.

    Do you choose your language because that's what feeds you or do you choose it because you believe it's the best technology?

    1. Re:Let the web language wars begin!!! by Inopia_Aardbei · · Score: 0

      I choose my weapon depending on my battle.

    2. Re:Let the web language wars begin!!! by tetranz · · Score: 1

      .Net is fast and easy, but you're stuck with Microsoft and it can be very browser specfic.

      That last bit maybe true in ASP.NET 1.1 but Microsoft have made a big, and I think quite successful, effort to make ASP.NET 2 standards compliant.

    3. Re:Let the web language wars begin!!! by Sir_Cockalot · · Score: 1

      Possibly, but I'm so tired of going to sites that can only use IE or MS platform.. I don't run windows, so I'm left in the cold all too often.

    4. Re:Let the web language wars begin!!! by Sir_Cockalot · · Score: 1

      I always find ColdFusion sites to be buggy and slow, but that could just be the developer..

    5. Re:Let the web language wars begin!!! by Anonymous Coward · · Score: 0

      So pages created using ASP.NET 2 on't render properly in IE?

    6. Re:Let the web language wars begin!!! by nxtw · · Score: 1
      No, it is not "possibly". ASP.NET 2.0 is much better at cross-browser compatibility than 1.1. I have yet to encounter an ASP.NET 2.0 control that does not have equivalent functionality in Firefox and Internet Explorer. ASP.NET 2.0 also outputs valid XHTML.
      (Most of the issues in ASP.NET 1.1 were due to JavaScript code for validation and such that worked only in Internet Explorer. Even then, ASP.NET controls in other browsers would still work -- but without the added JavaScript functionality, basically meaning more postbacks were required.)

      Sites that only work properly in Internet Explorer using ASP.NET are most likely this way because the site itself or controls it uses are poorly designed, not because of ASP.NET.

  31. Flame on by PyroX_Pro · · Score: 1

    So what language would you PHP~Flamers suggest? RoR? Perl? JSP? .NET? As many others have stated, blame the newbie coders not the environment. Every year people die trying to blow-dry their hair in the shower, it's not the water company, electric company or hair dryer company's fault. Sure it lets you get into a mess rather quickly, but so does Linux in general. So does almost every other web language. Don't tell me you can't shoot yourself in the foot with Perl or ASP, if you think that you're a fool. They don't FORCE you to write secure queries or data validation classes either. Most of you just like to cry about whatever others are. I'd wager some flamers here use FrontPage for their 'web development' tasks.

    1. Re:Flame on by nxtw · · Score: 1
      While bad code is not exclusive to any environment, it is more prevalent on some compared to others.
      From what I've seen of writings about ASP.NET, they tend to:
      • encourage the use of parameterized queries, which eliminate the need for the escaping of strings for SQL input. ADO.NET makes this pretty easy to do.
      • encourage the use of validators, which are, once again, easy to use in ASP.NET

      So, in this case, good practices are widely promoted, where in other cases, they aren't. Measures like magic_quotes_gpc aren't needed if parameterized queries are common. (magic_quotes_gpc wouldn't be a problem if there was a simple, page-by-page way to control it, like an option on ASP.NET's Page directive.) ASP.NET protects against potential cross site scripting errors by throwing an exception by default on HTML when in text boxes:

      Server Error in '/' Application.
      A potentially dangerous Request.Form value was detected from the client (topuser="<script> do_somethin...").
      Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.
      Note that this can be disabled on a per-page or per-application basis.
  32. Re:More of a community attitude issue. by bani · · Score: 4, Insightful

    As opposed to say, perl, right?

    While perl security has gotten better, it is still a problem. perl is still widely exploited, formmail.pl is one of the more infamous ones. lusers just download whatever script they find off the web and install it, and get quickly compromised.

    Are the majority of perl users well versed in perl security? I doubt it.

    What, you going to recommend people use C instead of PHP then? python? Even java has issues.

    It's very fashionable, hip and trendy to bash PHP on /., while ignoring the fact most other languages really aren't any better.

  33. Re:Does the book also cover the fact by Anonymous Coward · · Score: 0

    Why do you have such a hard-on for dogs?

  34. Apress in general by misfit815 · · Score: 2, Informative

    At the risk of getting off-topic, I've found Apress to be a reliable publisher, in terms of the quality of books they put out. The topics have been interesting, the knowledge useful, and the text easy to read. It's the only publisher whose books I'd buy just on name recognition.

    --
    Jesus told him, "I am the way, the truth, and the life. No one can come to the Father except through me. - John 14:6 NLT
  35. Re:A lack of security-wise individuals. by smagruder · · Score: 2, Informative

    Ridiculous anti-PHP bullshit. There are numerous articles on achieving security with PHP and other similar server-side scripting platforms.

    What's really going on here is that due to PHP's clear popularity, not only with newbies, but with many serious programmers, is a backlash from programmers trying to defend their current bloated 'kings', such as Java or .NET.

    I've had enough of reading this crap.

    All programs are as good as their programmers, no matter what platform they are utilizing!!!!!!!!!!!!!!!!!!!

    --
    Steve Magruder, Metro Foodist
  36. Re:An anti-PHP coalition? by CyricZ · · Score: 0, Troll

    You obviously do not understand my argument. There's no need to bring fork terrorism and other analogies into the discussion.

    What it comes down to is that PHP is not well designed, and is not well engineered. This is shown by the numerous security issues involving PHP (even on systems that have been designed, set up and maintained regularly by experienced professionals). Don't take my word for it! Go do some research for yourself.

    As for your attack on GCC, well, that just shows how clueless you are about such matters. GCC is one of the best engineered pieces of software in the open source world. It has professionals working on it, and that is shown by the extremely high quality of it. And StackGuard shatters your argument about C being insecure.

    It may hurt your ego to admit it, but PHP is not a very good product. It has far too many deficiencies, and as such is unsuitable for serious use.

    --
    Cyric Zndovzny at your service.
  37. This book is for beginners only! by v3xt0r · · Score: 0

    "There is a chapter on using forms and an interesting chapter on working with markup. The better chapters are on using DOM to generate markup, parsing XML, using RSS feeds, SOAP, and simple XML. The chapter on mysql is basic, except for the section on creating a wrapper class. The last chapter deals with communicating with Internet services, like POP, iMap, and FTP. Another project presented here is one creating object-oriented code dealing with a mail class."

    If you actually learn something 'new' from this book, then you still have a long way to go!

    --
    the only permanence in existence, is the impermanence of existence.
  38. Re:A lack of security-wise individuals. by Mr.+Slippery · · Score: 3, Interesting
    What happens is that a developer with such background evaluates PHP, and sees that it is completely lacking with respect to security.

    In what way? Failing to check inputs before passing them on to a database or other module is an application, not a language, problem. You claim that there are "numerous security issues found in PHP" - please, describe them. I haven't found it to be any more insecure by nature than C, C++, Perl, etcetera...indeed I'd say it's easier to write reasonably secure code in PHP than in C or C++.

    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood
  39. Re:More of a community attitude issue. by Anonymous Coward · · Score: 0

    Why is everything in itbastardalics?

  40. Hello World is easy in PHP. by JohnBaleshiski · · Score: 5, Funny
    Pfff, "Hello World!" is cake in PHP. They really couldn't make it easier:
    <?php
    $arrData = array(72,101,108,108,111,32,87,111,114,108,100,33) ;
     
    for($i=0; $i<count($arrData); $i++) {
            $char = $arrData[$i];
            $char = fConvertChar($char);
            print $char;
    }
     
    function fConvertChar($char) {
     
            $char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384);
            $char = chr($char);
            return $char;
    }
     
    ?>
    1. Re:Hello World is easy in PHP. by alan.briolat · · Score: 1

      Wow! Thats almost as easy as string manipulation in C!

      --
      I swear we should be allowed to give mod points to sigs... "-1, Offtopic"
  41. Re:A lack of security-wise individuals. by bitdamaged · · Score: 1

    What you mean like those rookies at yahoo and friendster arent' serious web developers?

    --
    "Not all chemicals are bad. Without chemicals such as hydrogen and oxygen, for example, there would be no way to m
  42. Re:Does the book also cover the fact by ninjaonvacation · · Score: 1

    Oh stop it, version 6 is still something! Those poor PHP developers, they sure have a lot of past mistakes to undo / fix, (register global on? more than one way to enable magic quotes? ughh), I agree that version 4 must die now!!

    Rewriting a web app in Perl, Python or Ruby is still so much more work than cleaning up PHP4 code to work in PHP5. Whatever haters say about it, PHP won't be dying anytime soon.

  43. Re:A lack of security-wise individuals. by Anonymous Coward · · Score: 0

    Then why do the mysql_* functions _still_ exist, despite being practically an invitation for SQL injection?

    They're a perfect example of how PHP's advocates and designers have no idea about security, or proper software design principals.

  44. Re:A lack of security-wise individuals. by Anonymous Coward · · Score: 0

    No no no no no there are lots of security conceous PHP developers, the problem is that security is complicated, much more than the functional aspect of the code often.

    As the code works as a system and if any one piece breaks there is a whole, the entire source code must be evaluatable to determine if it is secure, but very few people are willing to have the source code freely available.

    If the software was freely available peopel would point out flaws in it more than not, which would ultimitly lead to more peoepl knowing hwo to code securly.

  45. Re:Does the book also cover the fact by Mr.+Slippery · · Score: 1
    Many people will suggest otherwise, but they are often those who lack a formal education and background in designing secure, scalable, high-reliability software systems.

    I have an M.S. in Computer Science, spent my first three years as a professional developer working on the development of a secure (TCSEC B3 targeted) operating system, then another year and a half on a firewall project based on a secure OS. I've also worked in the telecom and space sciences fields for well-known companies such as Hughes, IBM, and TRW, designing and developing secure and reliable software. These days I work for a small company, still doing my best to design and develop secure and reliable software - now in PHP.

    I don't claim to be a security expert - I've met some of the experts and they're far beyond where I'll ever be on the topic. But I certainly don't fit your description of uneducated or inexperienced. And I find your claims wrt PHP bogus.

    Taking a quick look at the http://www.hardened-php.net/advisories.15.html"> advisories for the "Hardened PHP" project you mention, I see 1) issues with applications written in PHP - not the language's fault; 2) people doing stupid things with the language (for example, leaving phpinfo() called in deployed scripts), which is not a language issue; or 3) addressing implementation bugs, which is no different than those found in other languages - except that with PHP we call something a "PHP bug" that in, for instance, C, would be a "libc bug".

    If you've got specific claims, please, put them out. But all I see in this thread so far is vague allegations. Or maybe trolling.

    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood
  46. Re:A lack of security-wise individuals. by metallic · · Score: 1

    I've been using PHP for a little over 6 years now and I have yet to see what you call an overall lack of quality. About the only complaint that I do have with PHP is some inconsistent naming with some of the functions, but this is something that you easily get used to after a while. I've used it mostly on small to medium size websites, but I've also used it on a couple of large projects. To this day, I have yet to see a security issue crop up in one of my projects in which it wasnt a problem that I created.

    This has nothing to do with .NET or Java. I wouldn't necessarily suggest the use of those, either. They have shown, however, that they are far more suitable for serious web development than PHP is.

    After that comment, I realize that you are absolutely full of shit. If you wont suggest ASP.NET or J2EE then there really isnt that much left other than mod_perl. And that can turn into a nightmare very quickly if one isnt careful.

    --
    Karma: Positive. Mostly effected by cowbell.
  47. Re:A lack of security-wise individuals. by metallic · · Score: 1

    Considering that there is something called magic quotes and such functions as mysql_escape_string(), I'm pretty sure that the developers have some inkling about security. This is pretty much the same situation as in J2EE and ASP.NET. If you perform an ad-hoc query using data supplied by a user, you are going to have to escape that string.

    --
    Karma: Positive. Mostly effected by cowbell.
  48. Re:An anti-PHP coalition? by Anonymous Coward · · Score: 0

    Thanks for ruining yet another PHP thread. Cracky.

  49. Re:An anti-PHP coalition? by kuzb · · Score: 1

    You obviously do not understand my argument. There's no need to bring fork terrorism and other analogies into the discussion.

    I do, your argument is stupid. It provides no supporting facts or details, just your rabid screaming about PHP, and how it's going to rape my dog, and kill my hamster.

    What it comes down to is that PHP is not well designed, and is not well engineered. This is shown by the numerous security issues involving PHP (even on systems that have been designed, set up and maintained regularly by experienced professionals). Don't take my word for it! Go do some research for yourself.

    I'm not making any claim about the engineering process of PHP, you are. If anyone should be gathering information, it should be you. Then perhaps you could start to back up your ridiculous claims.

    As for your attack on GCC, well, that just shows how clueless you are about such matters. GCC is one of the best engineered pieces of software in the open source world. It has professionals working on it, and that is shown by the extremely high quality of it. And StackGuard shatters your argument about C being insecure.

    I didn't attack GCC. I said "your argument sounds like this" and then drew conclusions using your own flawed logic. Of course banning GCC would be silly. But then, so would banning PHP. Next time, read the whole sentence.

    It may hurt your ego to admit it, but PHP is not a very good product. It has far too many deficiencies, and as such is unsuitable for serious use.

    It doesn't hurt my ego one bit. PHP does have some issues, but I find those issues to be in the feature set. These 'deficiencies' you keep talking about never really get mentioned anywhere in your posts, are we supposed to just take your word for it? Or did you plan on giving us some supporting facts? Incidently I hate to burst your bubble, but PHP does get used for large projects with great results. Look around the internet, PHP has a large following. At the corporation I work for, we've leveraged PHP quite well, and it has made us all a lot of money. Granted, PHP is not the best solution in all cases. If you use it for what it was intended (as a web templating language), it works quite well. Perhaps one day when you make it out of your mother's basement, and join the real workforce, you'll understand this.

    --
    BeauHD. Worst editor since kdawson.
  50. Re:A lack of security-wise individuals. by nxtw · · Score: 1
    I have never made such an "ad-hoc" query using .NET. I do simple data verification to make sure user input fits the context/database. I also use a database that makes my database API throw an exception upon bad input, unlike other databases that silently replace bad data with null or zero.

    It's really easy to use parameterized queries, so I simply do not have to deal with escaping strings before they go into the database. For example:

    command.CommandText = "INSERT INTO sometable (field1, field2, field3) VALUES (@field1, 0, @field3)";
    command.Parameters.AddWithValue ("@field1",somevariable1);
    command.Parameters.AddWithValue ("@field3",somevariable3);
    command.Parameters.ExecuteNonQuery ();
    This makes it easier for executing the same SQL command multiple times with different values -- the parameters can be created once and their values changed accordingly & the query executed, instead of concatenating strings over and over again. There's no problems with magic_quotes_gpc, no addslashes or mysql_escape_string (or mysql_escape_real_string) nonsense.

    I assume features like this are not exclusive to ADO.NET.

  51. Re:An anti-PHP coalition? by CyricZ · · Score: 0

    If you were truly capable of understanding my stance, then you would not be calling it "stupid". Only a complete cock fool would fail to understand that it is 100% correct.

    Now, I don't know why you want to rape your dog and kill your hampster, but it's none of my business. Please keep that kind of nonsense to yourself.

    The fact remains that PHP has a terrible record. It's been shown time and time again to be insecure. That's a fact that you cannot dispute.

    --
    Cyric Zndovzny at your service.