Slashdot Mirror


Two Books On Programming With PHP

A few years ago, knowing just a few html tags and tricks could probably have gotten you a job as a full-fledged Web designer, or at least Web coder. As things get more complicated and Web sites more dynamic, the tools you need to create that all-singing, all-dancing user-interactive content have gotten more complex than carets and single letter tags. Danny Yee wrote these reviews of two of the many available books on PHP programming; to see Danny's hundreds of other reviews, check out the links provided at the bottom.

Web Application Development with PHP 4.0; The PHP Pocket Refere author see each pages see publisher see each rating 8;6 reviewer Danny Yee ISBN see each summary Both of these books are intended to serve as references for PHP programmers, but take different approaches in doing to.

Web Application Development with PHP 4.0 is a book one can actually read: it contains no undigestible slabs of reference material or code (these are relegated to the accompanying CD). Coverage of a wide range of largely independent topics also makes it a great volume for browsing in. And as a system administrator who does only a little bit of programming, in a variety of languages, I appreciated its "broad overview" approach.

The opening chapter of Web Application Development is a very brief look at some general programming issues - code formatting, documentation, APIs - that are all too rarely mentioned in programming language books. The second chapter covers PHP "advanced syntax": lists and arrays, object-oriented programming, and a bit on polymorphism and self-modifying code. (I finally got a handle on PHP's slightly odd handling of lists from this.) And chapter three presents a development example, coding an IRC interface in PHP.

Chapters four through seven cover a large selection of topics: sessions and session-handling, security, usability, validating form data, CVS, COM and Java interfaces, database integration, authentication, templates, XML, and WDDX. Much of this is not at all PHP-specific. Of the thirty-two pages on XML, for example, the first twelve are a general introduction that is not at all language-specific (the remainder describe how to use the Expat and LibXML parsers built into PHP, with examples). And the material on CVS presents some PHP scripts for automating notifications, but is otherwise completely generic.

I found the last two chapters less interesting. Chapter eight contains three case studies of organisations using PHP, but these are more sales pitch than substance (I really don't think it makes sense to be "marketing" PHP three hundred pages into a book on the language). The final chapter of Web Application Development is about modifying the C code at PHP's core. I skipped quickly over this and suspect the vast majority of readers will do the same.

Title; Authors Web Application Development with PHP 4.0; Tobias Ratschiller, Till Gerken Publisher, ISBN New Riders, 0-7357-0997-1 Other 384 pages, includes CD

(Order Web Application Development with PHP 4.0 from Fatbrain.)

The PHP Pocket Reference is right at the other end of the readable/reference continuum. It has two tiny discursive examples (of form handling and database integration) but otherwise is pretty solid: thirty pages introducing PHP syntax are followed by eighty pages of function prototypes with one sentence descriptions. And yes, it will fit into a (large) pocket. I have used the Pocket Reference occasionally, but I suspect only because it has been sitting next to my computer while I write this review -- once it goes onto more distant shelves, using the online documentation will probably be faster.

Title; Authors The PHP Pocket Reference; Rasmus Lerdorf Publisher, ISBN O'Reilly & Associates, 1-56592-769-9 Other 114 pages

(Order The PHP Pocket Reference from Fatbrain.)

Danny Yee's Book Reviews
Home | Subjects | Titles | Authors | Publishers | Latest A book review by Danny Yee <editor@dannyreviews.com>, Copyright © 2000

145 comments

  1. Re:Any advantage in PHP over mod_perl by Rasmus · · Score: 1

    Well, PHP 4 has a foreach() construct and also a database abstraction layer. So if these were the only two things you hated about PHP, you should be jumping for joy now.

  2. Re:Any advantage in PHP over mod_perl by Destrius · · Score: 1

    Would it be possible to add in better support for general scripting, maybe in some patched php binary? I'm not too sure, but when you run a php script from the command line, you'll get the HTTP headers in the output. And data seems to be outputted only when php completes execution of the script.

    I've been trying to learn perl for some time, but can't get the hang of it. I love PHP, however, so I'd like to use it for general-purpose scripts and not have to use too many tricks to get it to work.

  3. Re:Everythings Online by pberry · · Score: 1
    ...and yet people still buy books. Seriously though, some people (like myself) just don't do as well with online docs. O'Reilley books are vital to me in configuring samba and apache. Both of these have extensive online docs yet I still need the books. There is no latency ;-)

    --
    -- Are you an EFF member yet?
  4. Re:The Advances of PHP Documentation by YogSothoth · · Score: 1

    Hey Azog, with php4 you can do what you describe - here's a little sample code:

    <?
    class base
    {
    function someFunction()
    {
    print("base::someFunction()<BR>\n");
    }
    }

    class derived extends base
    {
    function someFunction()
    {
    base::someFunction();
    print("derived::someFunction()<BR>\n");
    }
    }

    $d = new derived();
    $d->someFunction();
    ?>
    Also, judicious use of error_handling (such as error_handling(E_ALL) helps *somewhat* with respect to the misspelled local variable issue)

    --
    there are two kinds of people in this world - those who divide people into two groups and those who don't
  5. carets??? by Manuka · · Score: 1

    I've never used carets (^) in web work. only < and >

  6. Re:Is this page by mortonda · · Score: 1

    I see it weird too, but only the main review page... clicking on a subcomment made the problem go away.

  7. Re:Offtopic by hobbit · · Score: 1

    I would assert that if your Karma goes down, it is because the slashcode thinks that you have mismetamoderated. Perhaps if you disagree with moderation, it verifies your opinion by asking another couple of people to metamoderate the same comment and, if both of them are of the troll mindset, it's goodbye karma time.

    I would also like to point out that improving slashdot is not just a matter of metamoderation and moderation, it is a matter of generating intelligent discussion through posting insightful/informative/whatever comments. If no-one sees these because your karma is negative, it detracts from slashdot. Obviously there is no easy answer to finding the right balance.

    Hamish

    --
    "Wise men talk because they have something to say; fools, because they have to say something" - Plato
  8. Re:annoted manual at php.net rules by Signal+11 · · Score: 1

    Just chiming in here to agree with you - I learned PHP solely from the documentation. Sadly, it is not as good as it could be. But compared to java, it's a godsend. =)

  9. Re:Offtopic by waldoj · · Score: 1

    My karma went down from the karma-frozen 122 to 121 two days ago because I had a post go from a 3 to a 2 (and then up to a 5). Yet, at other times, the karma freeze has prevented my karma from going down. I don't get it.

    So I'm a dork, and I'm tracking my "theoretical" karma, which would be 143. :) The only thing lamer than obsessing about karma is obsessing about theoretical karma.

    -Waldo

    -------------------

  10. Re:Way Offtopic [was Re:Offtopic] by waldoj · · Score: 1

    Damn, that had to hurt. I wish that Slashdot would post something about this, at least something in the FAQ. This is frustrating, but I feel like we have to discuss this in weird little threads like this in order to get an idea of what's going on. Not cool.

    -Waldo

    -------------------

  11. Re:Any advantage in PHP over mod_perl by sanderb · · Score: 1
    Well, PHP 4 has a foreach() construct and also a database abstraction layer. So if these were the only two things you hated about PHP, you should be jumping for joy now.

    I wanted to jump for joy, my major peeve with PHP is the different database interfaces also.
    But I could not find the database abstraction layer looking at the manual. All I could find was a layer for a couple of specific databases.

    I think what the previous poster and I are looking for is a general set of functions that work for MySQL, Postgres, Oracle, ODBC and other SQL-databases, which would only require a change in the connect/open function-call in the code should there be a switch in DBMS.
    Is there such a system in PHP now? Otherwise, no jumping....

  12. Re:Offtopic - BAD MODERATION by tuffy · · Score: 1
    Clearly the post is both, but since Slashdot offers no place to discuss Slashdot itself, there's nothing else to do save for making offtopic threads such as this one.

    Near as I can tell, points aren't given for metamoderation but you can certainly lose a bundle of them by labeling a post such as this one since the metamoderators are unlikely to check the post's context and "disagree" with whatever you pick. Just think of it as thanks for a job well done.

    --

    Ita erat quando hic adveni.

  13. Re:Offtopic by tuffy · · Score: 1

    And if you moderate in a way others disagree with, you'll also lose karma. Consider it a little penalty for your hard work in trying to keep Slashdot a better place. Or, just uncheck "willing to moderate" and avoid the game altogether.

    --

    Ita erat quando hic adveni.

  14. Both Books by Anonymous+Nerd · · Score: 1

    I have both books, and while I only just got the developing web applications with php 4, I have had the pocket reference for some months now and have used to quite extensively, however while I am using the pocket reference I also tend to use the online doco at the same time for a more indepth usage of the function that I want to use...

    I have read the first few chapters of Developing Web Application, and I think that for some software developers these chapters are a must, because most of us tend to forget about the good coding practices that we all learnt back at college or university...

    All in all, I would rate the pocket reference as 7.5/10 and the Developing Web Applications book at 8/10 just based on the first few chapters.

    Good references for PHP programmers

    --
    "Minds are like parachutes: most people use them only as a last resort."
  15. Re:PHP vs Mason by Pope+Slackman · · Score: 1

    Huh? In what way is PHP primative?

    I drifted from Perl to PHP a while back, and I can't really name many things that Perl has built-in that PHP doesn't. The only thing I consistently find myself missing is 'foreach'. (Which, FWIW, is in PHP4, along with a lot of other new functions.)

    --K
    ---

  16. Re:You will hardly lose points moderating up by Zoyd · · Score: 1

    Pac:
    I metamod ALL positive moderations as Fair.

    Let me guess: You are under 25?

    I Metamod most positive moderations as unfair and almost all negative moderations as fair. When I have mod points, I sometimes spend hours wading through garbage posts looking for a single useful post. The mountain of garbage posts Slashdot has turne into is partially and indirectly thanks to the hard work done by meta-modder Pac. The problem with the moderation system is immature brats upmodding garbage comments and fairmetamodding garbage moderation, all of which encourages garbage postings.

    I'm 30 y.o. If you are under 25 and care about the health of the moderation system do not moderate or meta-moderate. If you are under 25 and find yourself with mod points, throw them away by modding down offtopics.

  17. Re:The "Programmer to Programmer" WROX books... by Zico · · Score: 1

    Heh, you gotta forgive me, I just couldn't pass that up. I checked out my Wrox PHP book today, too, and can't argue with you too much — Jesus looks like he gets hammered every weekend, and the other dudes look like they've never even seen the sun.

    I do like the pics on the front — it's different, and makes me relate to the guy (I can't remember any of their books with women on the cover) whose words you're reading, except for the dreaded Wrox books that have like 20 guys on the cover. It'd be cool if people referred to the Wrox books the same way they do with some O'Reilly books, like the Camel Book: You could have, say, the Buck-Toothed Book, the Bad Goatee Book, or the Intimidating Unibrow book. :)

    The New Riders covers are kinda nice and subtle, too — the cover art I'm not all that fond of is Manning's series, with the people in unflattering period costumes that look like they were drawn in crayon. Not sure what's up with that...


    Cheers,

  18. Re:Any advantage in PHP over mod_perl by cs · · Score: 1
    PHP is simple and easy to learn (it appears; I'm still in that phase). mod_perl is WAY more mature.

    Basicly, PHP has a very crude language (I mean, OO without object destructors? get real!) The manual is skimpy. No barewords :-( No distinction between arrays and hashes. No anonymous structures.

    My feeling is that for fairly small things PHP is the go, for complexity or nontrivial things Perl is a far superior choice. (BTW, shopping carts and product catalogues fall into the former category - they're apparently perfectly tractable in PHP.)

    --
    Cameron Simpson, DoD#743 cs@cskk.id.au http://www.cskk.ezoshosting.com/cs/
  19. Re:I've stuck to online resources by Evro · · Score: 1
    Yes, phpbuilder is "the other site" I used when learning PHP. As I said in another post, the PHP docs are possibly PHP's greatest feature (all would-be php programmers bookmark http://www.php.net/manual/ now).

    And as you say, online resources are really all you need with PHP. Whereas with Perl I had to buy two books and needed a lot of supplemental help online (installing dbi, etc).

    __________________________________________________ ___

    --
    rooooar
  20. php docs kick perl's ass by Evro · · Score: 1
    For me, at least, the advantage of PHP, by far, is its documentation. Any question, I go to php.net and there is the answer. Their function definitions are all yummy. Also the built-in db access is much easier than using/installing DBI if you're brand new at this (as I was when learning php). I find the documentation at www.perl.com to be quite poor. Perldoc is good, but nothing can compare to http://www.php.net/manual/ imnsho.

    __________________________________________________ ___

    --
    rooooar
  21. Re:O'Reilly by delysid-x · · Score: 1

    Dude, one of the books listed IS O'Reilly. I bought the Pocket Reference and have found it to be completely useless ever since... sure, it's got all the commands in it, but the command and a sentence telling you what it does is kinda useless. No examples, no parameter explanation, nothing... This book is definitely the bottom of the heap when it comes to O'Reilly books.

  22. Re:annoted manual at php.net rules by delysid-x · · Score: 1

    Hear hear! The online manual for php (http://www.php.net/manual/) is awesome! The user input and suggestions are super helpful when trying to find the best way to do something. Made the jump from perl to php hella easy (heh, though it's not like they're vastly different languages)

  23. Re:With PHP, it's pretty much RTFM by delysid-x · · Score: 1

    The index of functions: http://www.php.net/quickref.php

  24. Web Application Development and PHP resources by Internet+Ninja · · Score: 1

    While the case study chapter may not be interesting to most, the last chapter on extending the Zend engine should be a must read for anyone wanting to add their own functions.
    It has the blessing of the Zend team as 'the' resource for extending Zend and that chapter is also published under the Open Content License meaning it can be distributed outside of the book just like any other piece of open source software. Observant readers will note the inclusion of the open source license at the rear of the book.

    As for PHP resources, as someone pointed out, the PHP documentation is pretty damn fine and is available via CVS as sometimes the web version lags behind.
    PHPBuilder.com, Zend.com, FAQTS and Weberdev amongst others all have plenty of applications, tips and tutorials.

    Graeme

  25. Re:The Advances of PHP Documentation by Azog · · Score: 1

    Hey, thanks for the info!

    That error_reporting() call is what I want, and, it looks like it's in PHP3 as well. Doh! If I had known that a month ago, I would have saved a lot of debugging time. That is the kind of information that should be front and center in all PHP documentation.


    Torrey Hoffman (Azog)

    --
    Torrey Hoffman (Azog)
    "HTML needs a rant tag" - Alan Cox
  26. Web Programing, Display and Content by Q-bert][ · · Score: 1

    The one thing I've never seend addressed in any book dealing with programing for the web is how to seperate 1) programing logic from the html (tho not insanely hard) 2) seperating html from the acutal content. and 3) keeping sane. (Note: I really need some help with 3). One thing I do with my GUI programing is to abstract whatever toolkit I'm using within my program so I can protect myself from changes in the underlaying display logic. Ie: (myprogram_New_Window is the same regardless if I switch from GTK to QT to ncurses) There are no books that discuss diffrent methods on how to do with with web programs, pros and cons of diffrent methods etc. Also, I've yet to find any real good discussion on how to seperate your acutal content from the html. I would really like a book that describes when it's best to use a database or a meta-file format such as XML, etc. Because what I encounter the most is that clients have all of their content in html files, or their acutal program logic is centered around the output html, that when you go to change the layout and look of the site you basicly have to do everything by hand all over again. It would really be helpful to have information coverting these topics. Programing languages are really just means to an end. What is really useful are the ideas that are implimented with the languages.

    (All speling, punciuation, and gramatical mistatkes are mine, and also mine; (mine too!

  27. Re:Any advantage in PHP over mod_perl by lal · · Score: 1

    I've built medium-size web applications (6 month development projects) in both, and settled on a mix of PHP for presentation and Perl for scripting. They are both great languages. Here's what I've found from experience:

    PHP was built specifically as a web presentation language. It has everything you need, and no more, to build the pieces of a web site that a user touches.

    PHP also runs leaner in Apache. With mod_perl, you are embedding a perl interpreter and all of the memory used by your apps into each Apache instance. There is some shared memory going on, but mod_perl is much bigger. The programmer must also be much more careful about memory usage with mod_perl. Perl advocates would argue that mod_perl is therefore faster, and they might be right. But PHP seems fast enough.

    Perl is, IMHO, a better general-purpose language. PHP does have a command-line version, but Perl just "feels better" to me to write scripts to load databases, munge files, etc.

    A huge part of the Perl benefit is the extensibility provided by CPAN modules. CPAN is a beautiful thing. PHP does not have anything like it that I've found. Most PHP code sharing is .inc modules that you need to customize to get to work. There's a lot of great code out there for PHP, don't get me wrong, it's just harder to get at and use than CPAN.

    Finally, both Perl and PHP are rock-solid. When there's an error in a web app I write, it's mine, and that's a huge blessing.

  28. Re:Any advantage in PHP over mod_perl by Sxooter · · Score: 1

    The fix for that is easy, either:

    ?> php -q script_name

    or put #!/usr/local/bin/php -q at the top of all your scripts.

    flush() will force output to stdout.

    --

    --- It is not the things we do which we regret the most, but the things which we don't do.
  29. Re:Any advantage in PHP over mod_perl by haizi_23 · · Score: 1

    for me, php's object syntax is a lot easier to deal w/ than perl's. defining and working with classes is much easier. also, it's very similar to asp/jsp in the way you mix scripting code and markup, so if you're used working in either of those models, and a project comes up that's either perl or php, php is a more natural transition.

  30. Re:The Advances of PHP Documentation by bolind · · Score: 1

    I don't mean to be nitpicking here, but the guy's name is actually "Rasmus Lerdorf".

    Go here for proof.

  31. Re:O'Reilly by cowboy+junkie · · Score: 1

    Amazon has an O'Reilly title called 'Programming Php' due for release in January 2001 by the same authors of the pocket reference and the O'Reilly mySQL book.

  32. NO YOU FOOL! DON'T CLICK THAT LINK!!! by macdaddy · · Score: 1
    The Amazon Hitler youth will track your cookies, bagels, and biscuits and charge you a higher price than they charge others!

    Use THIS LINK and you won't get stiffed in the end!!!

    To be honest, I wouldn't be surprised if they charged you more if your referrer is /. or if you were using a Linux browser. Those bastards! They killed Tux!

  33. Re:Any advantage in PHP over mod_perl by Betcour · · Score: 1

    Also for scripting, one might want to disable the default time-out (system scripts can take a while to execute...). If the system script is started from a web browser, then disabling user_abort too might be a good idea !

  34. Re:I really like this PHP book by Wakkow · · Score: 1

    Professional PHP Programming from Wrox.

    I agree.

  35. Re:You will hardly lose points moderating up by Fleet+Admiral+Ackbar · · Score: 1
    Positive moderation can be as bad as negative. As has been said before in this thread, unthinking positive moderation puts junk up in the public eye ("Imagine a Beowulf cluster of these!!! Kewl! I want one! Linux rox!") and hides unpopular but worthwhile ideas behind a screen of self-reinforcing crap.

    Take a look next time when you metamod positive comments. Did it deserve to be positive, or was it simply a restating of your own, sheeplike, beliefs?

    --
    Carefree highway, let me slip away on you.
  36. Re:The "Programmer to Programmer" WROX books... by Fleet+Admiral+Ackbar · · Score: 1
    Dude, you took the name of a fucking Star Wars character. Who are you trying to kid? :)

    What, you don't believe that I'm some kind of stud? I'm a pretty tough guy:)

    --
    Carefree highway, let me slip away on you.
  37. The "Programmer to Programmer" WROX books... by Fleet+Admiral+Ackbar · · Score: 1
    Picked up the PHP book the other day, and mein Gott, those are some dorky-lookin' bastards on the cover! Only that Jesus C. dude looks like anyone I would want to go clubbing with.

    Why do they put these guys' pictures on the cover? Do they think I will respect the content more if the cover features geeks instead of woodcarved animals? Or does it operate along the lines of, "Well, if these people have spent that little time attending to their personal appearance, they must have mastered all aspects of programming with the time they saved?

    Or is it a "Whew, thank G-d I'm not as geeky as those people. I'll buy this book, regardless of what's inside, because just having these pictures available affirms me and my appearance?"

    --
    Carefree highway, let me slip away on you.
    1. Re:The "Programmer to Programmer" WROX books... by Zico · · Score: 3

      Fleet Admiral Ackbar wrote:

      Whew, thank G-d I'm not as geeky as those people

      Dude, you took the name of a fucking Star Wars character. Who are you trying to kid? :)


      Cheers,

  38. My enemies' enemies are my friends... by Ground0 · · Score: 1
    I remember hearing that once, someplace but it does seem that many people should remember that just because you are a proponent of one technology that don't need to be an opponent of other technology.


    Why do I often get the impression that we are fighting over the scraps when if we worked together more, we could take the feast from M$?


    Does anyone think that the one dentist out of five that does not recommend Trident Gum to their patients gets ridiculed by the other four?

  39. Re:Why they put author photos on there by Master+of+Kode+Fu · · Score: 1
    A friend who works at a certain on-line bookstore in Canada says that Wrox believes that it lends a more personal touch to otherwise dry books and that they also believe that geeks like to see other geeks on the cover of geek books.

    Personally, I would like to see airbrush van art make its comeback by appearing on Wrox press books. Keep on truckin'!

  40. Re:Any advantage in PHP over mod_perl by java.bean · · Score: 1

    I asked myself the same question, but in the reverse direction. I'm not a professional web developer, but I do alot of web development in my job. I had been using PHP, and was looking at learning Perl. Perl has since become so useful to me for doing miscellaneous things that I wanted to use it for web development as well -- why bother remembering two sets of syntax for doing essentially the same thing? Then I discovered Mason, which lets you embed Perl into web pages just like PHP does (there are other ways of doing this too). That sealed the deal; I haven't touched PHP in months.

    --jb
  41. Re:Offtopic by DeadSea · · Score: 1
    Consider it giving your karma to a good cause. If you really like slashdot, you won't mind a bit of personal sacrifice to make it better.

    Sadly since the karma cap became active, some of our karma has nowhere to go but down. You are indeed blessed my friend.

  42. Re:Any advantage in PHP over mod_perl by Bassthang · · Score: 1
    Interesting and insightful comments. I guess PHP and Perl are both useful languages, though perhaps at different stages of maturity. I came into Perl programming from a sysadmin/scripting/text-file-parsing angle, and only subsequently used it for web-scripting. Recently I had to use PHP for a project, and any comments I make are possibly tainted by frustration at that project, not the language itself. Though I did find that we ended up solving many problems (mainly system level stuff, calling exisiting Perl code, etc) by using the PHP to call a perl script ...

    My beef with system() and exec() in PHP is that the only difference between them is whether output is echoed. This is somewhat different to the standard unix meaning of theese functions.

    Since this is meant to be about books, I would say don't bother buying one to start with. The learning curve for PHP is pretty gentle. Certainly don't buy the Wrox book. The php.net documentation is in the main pretty darn good, and continuously improving.

    (But what is it with all the rounded corner websites .... ????)

    --
    "What I look forward to is continued immaturity followed by death."
  43. What do you need to know? by Kidbro · · Score: 1

    Considering a lot of the people I work with regularly, I'd say that even today "knowing just a few html tags and tricks [can] probably [get] you a job as a full-fledged Web designer". I'm serious :(

  44. Re:Offtopic - BAD MODERATION by MemeRot · · Score: 1

    And did anybody notice that THIS post which is COMPLETELY offtopic was modded up as interesting? When it clearly should have been modded as offtopic since the author took the time to clearly label the post offtopic? Now what would happen if i metamodded it down as offtopic? If more people had modded it up would i end up losing karma?

  45. Re:I've stuck to online resources by Egorn · · Score: 1

    For those of you that don't know here the PHP Manual is it's: HERE also use the errata it's very convenient to see other peoples examples. Even emailing them at times is helpful I have about 5 people email me a week with questions and I always try to help them.

    And finally what there is a lot of open source code in PHP that is incredibly usefull. My own for an example. My Most popular one is: Jack's Formmail.php a PHP clone of Matt Wright's Formmail..

    --

    Movie News - "Entertainment news, bitch!"
  46. Re:Perl AND PHP on the same site? by Egorn · · Score: 1

    We have a pretty good setup on our site that is running perl, php3 and PHP4.

    I like using perl for anything that will be behind the scenes on a web site and for jobs that will be run once a day etc.. (note: headline grabbers etc..). all our files named php3 are run by PHP3 and files named *.php are run by PHP4 and *.pl and *.cgi etc.. are PERL.. it is indeed possible and even neccessary to run both

    --

    Movie News - "Entertainment news, bitch!"
  47. Re:Advantages to PHP over Perl? by Egorn · · Score: 1

    I'm more comfortable with PHP, so I use it. It's as simple as that.

    The whole PHP vs PERL Thing is best answered this way!

    --

    Movie News - "Entertainment news, bitch!"
  48. Re:Online Books? by horza · · Score: 1

    Depends how seriously involved you want to get with your site. I find Professional PHP Programming by Wrox press an excellent desktop companion. If you want to turn it into your profession (as a techie) then I would recommend expanding your computer knowledge in the following areas:

    • Operating systems
    • Databases
    • Algorithms
    • Networking (sometimes called Communication Systems)


    Pick up a 1st/2nd year University book on each of the above courses. Despite being quite theoretical they can make fascinating reads. Especially if they include some background on how the theory came about. You will then feel a lot more comfortable in the practical implementations as you know roughly what's happening "under the bonnet". The things you learn in algorithms you will find you can apply to any computer language, including PHP.

    Phillip.

  49. Re:PHP vs Mason by horza · · Score: 1

    PHP is a worthy competitor to Perl. But compared to JSP it's strictly stone knives.

    Disagree. Two different tools for two different jobs. I am a Java programmer by profession but am coding my new software in PHP. Why? Rapid development and flexibility. PHP is far faster to code an up-and-working system, and to amend it when the specs change. Then I'm in the unusual position of writing to a vision as opposed to writing to a specification. Once everything is perfect and beta tested, as load stretches I will probably rewrite in Pure Java. Not JSP though, which I don't have a high opinion of, but either servlets along with a custom template engine or some worthy application server.

    Phillip.

  50. Re:Is this page by nachoman · · Score: 1

    it seems to be fixed now

  51. Re:Is this page by nachoman · · Score: 1

    It's funny for me too. I'm using Netscape 4.73 on Red Hat and it's all messed up. It's either a bug in the post or in the slash code. (Sorry this is a bit off topic)

  52. Re:Any advantage in PHP over mod_perl by Kean+de+Lacy · · Score: 1

    "The game of chess is like a sword fight. You must think first, before you move."

    Okay, this is completely offtopic, but have you ever fought with a sword? Think too much and you die. Cutting the brain out of the loop and running responses straight from the spinal cord is the only way to be fast enough.

    KdL

  53. Re:Advantages to PHP over Perl? by Jeppe+Salvesen · · Score: 1

    Well - I am also opening myself to flaming of the charring severity. However - it should not matter too much if you go with perl or php when you make database applications. The reason is simple - most of the system resources will go to the database daemons anyway provided the language is somewhat efficient. Disk access is incredibly expensive in computing terms. When you're dealing with a large database, that will probably dwarf what goes on in your script (unless you decide to read the results from a large query into an associative array or something equally dumb).

    So - for your purposes, I'd say PHP unless you know perl already - simply because the learning curve on PHP is nicer than on perl.

    --

    Stop the brainwash

  54. Re:Replies by dashmaul · · Score: 1

    I agree on that, that book was totaly worthless. However I have found MySQL by New Riders to a good book for learning to do PHP and MySQL

    --
    guvf vf zl fvt
  55. Re:Any advantage in PHP over mod_perl by jallen02 · · Score: 1

    Uhm short answer Yes:

    Why? Php is designed to do HTML Preprocessing, mod_perl *CAN* do it and you can actually write elegant code (check out slashcode) but I still think Php has several advantages.

    Now that Php4 is out classes are very easy and nice to handle.. wow just write your DB class and use it all over the place? changing databases? No problem no DBI kludge here, just rewrite your database interface class and viola your code is still the same.

    Ive done this and used it and it works.

    Ive about killed myself trying it with Perl.

    Ive been doin ColdFusion/Php for almost 2 years and Perl does *fit* but for Development time I like Php because its what im familiar with (not thats personal not a plus or minus for perl)

    But php has a whole bunch of quick functions such as encoding a string into URL format, decoding it coding HTML special characters.. the list goes on

    Its all done with RAD methodology in mind.

    You can write nice clean code with php that is GREAT for projects and code reusability now.

    With Perl you want something you gotta download 900 modules and it just drives me to distraction trying to decide to find a piece of code already written, write my own, get it all working ahh.. it just comes off as kludge I am one of those poor souless web developers who could never find and make peace with Perl.

    I *DO* like perl for doing some things, and I think its still viable for web development.. just if the shoe fits wear it right? Php is awesome and has all you need in one central place. Perl you ahve to pick and choose and hunt. :-)

    Jeremy

  56. Re:Well, GOOD web sites still use just those few t by jallen02 · · Score: 1

    I am working with an ASP which does full cross browswer stuff, almost all the scripting I do is purely to enhance functionality.. never just for show, tahts what marketing and flash presentations are for, dont let that *junk* in my mind get in the way or a useable product. :)

    Jeremy

  57. Re:Any advantage in PHP over mod_perl by mrfiddlehead · · Score: 1
    I'd say the biggest advantage of PHP over perl is readability. Perl can be so bloody obfuscated that picking up someone else's scripts can be a real !#%! pain in the ass. I use perl much more that php at this point because I use perl mostly for sysadmin type scripting. But if I were going to get serious about web programming I'd use PHP in a flash (no pun intended).

    I suppose it remains to be seen how obfuscated the PHP coders can get.

    --
    :wq
  58. Re:I really like this PHP book by stakk · · Score: 1

    I have this book in addition to PHP3 Programming Browser-Based Applications.

    The later was the first book I owned on the language, it was not however my first material on the language which happened to be www.php.net.
    Anyway I went on a tangent, what I ment to say was that the later though good material to get my hands dirty it was Pro. PHP Prog. that really got me hooked on PHP. Great examples and the case studies though I have never read them all the way through, I had been able to learn many do's and don'ts.

    What I was scared most of all when I first messed with php was everyone around me telling me that is was ASP for linux. I had never used ASP and have never used databases with a website before but now I have no clue how I might create a website without a database attached to it somehow.


    In case the point was missed with all the droopy comments, I greatly enjoyed the Wrox press book Professional PHP Prgramming as well.

  59. Why they put author photos on there by delevant · · Score: 1
    As I understand it, Wrox puts the photos on the main page for two reasons:
    1. It makes the books stand out. As you pointed out, people go "whoa!".
    2. It puts the author on the line. People will recognize him/her at trade shows -- if the book sucks, people will be able to pick them out of a crowd and start shouting. I think that's supposed to be an encouragement to not write crummy books.
    . . . I think the inside cover of at least one recent Wrox book explains this . . .

    --
    I have no .sig, and I must scream.
  60. PHP Vulnerability by Felipe+Hoffa · · Score: 1

    This bug was posted September 03, 2000, and no one have mentioned it so far. Does anyone have a solution?

    From Security Focus

    PHP Upload Arbitrary File Disclosure Vulnerability

    PHP's handling of uploads means that PHP applications can be manipulated into opening arbitrary files on the server, rather than those uploaded by the user. This may permit a remote user to read any file located on the server which is readable by a user of the server's privilege level.

    1. Re:PHP Vulnerability by bjclark · · Score: 1

      rasmus Sun Sep 3 22:09:46 2000 EDT

      Modified files:
      /php4/main rfc1867.c
      Log:
      Quick-fix for the file upload security alert
      @Quick-fix for the file upload security alert (Rasmus)

      Index: php4/main/rfc1867.c
      diff -u php4/main/rfc1867.c:1.38 php4/main/rfc1867.c:1.39
      --- php4/main/rfc1867.c:1.38 Sat Aug 5 23:40:28 2000
      +++ php4/main/rfc1867.c Sun Sep 3 22:09:46 2000
      @@ -15,7 +15,7 @@
      | Authors: Rasmus Lerdorf |
      +------------------------------------------------- ---------------------+
      */
      -/* $Id: rfc1867.c,v 1.38 2000/08/06 06:40:28 rasmus Exp $ */
      +/* $Id: rfc1867.c,v 1.39 2000/09/04 05:09:46 rasmus Exp $ */

      #include
      #include "php.h"
      @@ -64,7 +64,7 @@
      int eolsize;
      long bytes, max_file_size = 0;
      char *namebuf=NULL, *filenamebuf=NULL, *lbuf=NULL,
      - *abuf=NULL, *start_arr=NULL, *end_arr=NULL, *arr_index=NULL;
      + *abuf=NULL, *start_arr=NULL, *end_arr=NULL, *arr_index=NULL, *sbuf=NULL;
      FILE *fp;
      int itype, is_arr_upload=0, arr_len=0;
      zval *http_post_files=NULL;
      @@ -172,8 +172,10 @@
      }
      abuf = estrndup(namebuf, strlen(namebuf)-arr_len);
      sprintf(lbuf, "%s_name[%s]", abuf, arr_index);
      + sbuf = estrdup(abuf);
      } else {
      sprintf(lbuf, "%s_name", namebuf);
      + sbuf = estrdup(abuf);
      }
      s = strrchr(filenamebuf, '\\');
      if (s && s > filenamebuf) {
      @@ -252,7 +254,11 @@
      }
      *(loc - 4) = '\0';

      - php_register_variable(namebuf, ptr, array_ptr ELS_CC PLS_CC);
      + /* Check to make sure we are not overwriting special file
      + * upload variables */
      + if(memcmp(namebuf,sbuf,strlen(sbuf))) {
      + php_register_variable(namebuf, ptr, array_ptr ELS_CC PLS_CC);
      + }

      /* And a little kludge to pick out special MAX_FILE_SIZE */
      itype = php_check_ident_type(namebuf);
      @@ -353,6 +359,7 @@
      break;
      }
      }
      + if(sbuf) efree(sbuf);
      SAFE_RETURN;
      }

  61. Re:wtf? by Frizzle+Fry · · Score: 1

    > what's up with the whacked out colours? They demonstrate why you should be programming in php rather than perl (like slashcode is).

    Care about freedom?

    --
    I'd rather be lucky than good.
  62. Re:Web Programing, Display and Content by gaiusm · · Score: 1

    Take a look at Cocoon Cocoon maintains a clear separation between content, programming logic and presentation... Hope this helps, Gaius

  63. Re:Web Programing, Display and Content by revbob · · Score: 1
    The one thing I've never seend addressed in any book dealing with programing for the web is how to seperate 1) programing logic from the html (tho not insanely hard) 2) seperating html from the acutal content. and 3) keeping sane.

    My personal PHP style is different from most of the examples I've seen. Once I'm in PHP, I pretty much stay there and use print() to generate HTML. I figure it costs a little something to switch back and forth between the PHP preprocessor and the regular shove-it-down-the-pipe function of a web server.

    However, given that almost everything else you do in PHP or with a database surely takes longer than that, a rational person would no doubt conclude that this is just being anal (and needlessly distrustful of what the preprocessor might do to the contents of my variables when it isn't active). Same thing with making sure all my exit paths close the database once it's open. Automatically closing the database on exit and preserving the values in variables sound like things that probably attract quite a bit of the developers' attention and test time.

    So write it in PHP when it feels natural and looks readable (and, of course, when you need to, like when the HTML or text contains a variable value). Write in HTML other times. Whatever makes your document easy to read and maintain is probably the best advice.

    One thing (just to add further proof of my anality): always, always, always use GetImageSize() if you're serving up images. Don't do it the way they show in the example, though. Check for null in the return value, just in case somebody moved that image.

  64. Re:Web Programing, Display and Content by revbob · · Score: 1
    Oops. Sorry. I think I answered the wrong question.

    If anybody's come up with an answer to the question you actually asked, they sure haven't told me about it.

  65. Re:learning php by revbob · · Score: 1
    helped me code my first complex app in one day.

    This actually happened. I had a user call me up and say he thought the database I'd done (using PHP and MySQL) for participants in one of our programs was really cool, but he thought it would be neat if I could display them by job title as well as by name and location and the other sort criteria I had.

    I went on and on about how it was a major change and I couldn't see when I'd have time to get around to it (all the while going clickety-click). "OK," sez I, "hit reload."

  66. Re:I Agree by Kinetic+Kit · · Score: 1

    Basically, a good artist will design with the back-end application in mind and a good developer will write applications with the front-end in mind. Half of our (application developer's) quality assurance time is spent trying to get things to display in different browsers. Unfortunately, the various back-end languages (PHP, ASP, Perl, Cold Fusion, etc.) don't really figure into that in terms of compatability because they all provide the web server (usually Apache or IIS) with a full HTML page to send to the browser.

    --


    Can what is formed say to that who formed it, "Why have you made me thus?"
  67. Re:Advantages to PHP over Perl? by fredrik70 · · Score: 1

    Well, IMHO Perl is more scalable in the way that it is a more full fledged language. So I would use it for more complicated web applications, but when it comes to just formatting data from a database then PHP do the job more than well...
    just my 2 pennies

    --
    if (!signature) { throw std::runtime_error("No sig!"); }
  68. I wanna be on the cover of a WROX book! by Pinball+Wizard · · Score: 1
    This was a topic of discussion at my workplace not too long ago. We sell books, you see. It became a source of amusement to discuss the "models" on the covers of WROX books.

    I'd play devils advocate and ask the snickering girls if they'd go out with a certain WROX star if they made a six-figure income. Nope, didn't make a difference to them. A geek is a geek. I was however, reassured that most women look for more than money in a potential mate. :)

    --

    No, Thursday's out. How about never - is never good for you?

  69. Re:Perl AND PHP on the same site? by Pinball+Wizard · · Score: 1
    No actually I just wanted to see if I could host both from the same site. Having a single page being able to do both perl and PHP isn't an issue. I read somewhere that slashcode(perl with 15+ modules installed) had problems if you tried to run PHP pages on the same server. So I thought I would ask.

    Thanks to all for the answers!

    --

    No, Thursday's out. How about never - is never good for you?

  70. Re:I really like this PHP book by Erataikasu · · Score: 1

    Professional PHP Programming is okay, but it contains way too much PHP advocacy.

    I don't need to read 10 chapters about why PHP and open source are so great - I'm already using it, just tell me how.

    It also starts out very slowly - like it's geared towards non-programmers. That's fair enough, but not what I expected from a book called Professional PHP Programming; it's more like Beginners' PHP Programming.

    Oh, and the pics on the cover look like mugshots without the serial numbers. ;-)

    As for the PHP Pocket Reference, as the reviewer says, it's only a list of functions. A list of functions would be useful, except the descriptions are too sparse to find out what they do, and what the arguments are meant to be. Example:

    string date(string format[, int timestamp])
    Format a local date/time.

    Absolutely no info on what the format string should contain, what the timestamp should be (Seconds since 1970?), and how it differs from strftime, and gmstrftime, and gmdate, all of which format a date/time and take the same arguments.

    It's occasionally useful if you need to remember a function name, or the order of parameters, but I find myself going to the online docs more often. The php.net online docs have a great commenting system which often highlight the little quirks (aka bugs) of the function.

  71. Re:Any advantage in PHP over mod_perl by Erataikasu · · Score: 1

    PHP is very similar to Perl - I tend to consider it Perl without the syntactic sugar.

    In Perl:

    foreach $thing (@list) {
    print $thing
    }

    In PHP:

    reset($list);
    while (list($key, $value) = each($list)) {
    print $value;
    }

    This is the basic pattern - every place Perl has a nice new syntax to do something, PHP falls back on functions, or things that look like functions but aren't (like list()).

    PHP avoids new syntax like the plague. Sometimes this is good, sometimes annoying - I hate the PHP list/array syntax.

    I also hate that PHP has no database abstraction layer (Unless you use ODBC) - you change databases, you have to change all your database functions.

  72. Re:Any advantage in PHP over mod_perl by Erataikasu · · Score: 1

    Well don't I look foolish ;-)

  73. several come to mind immediately ... by Naum · · Score: 1

    i think perl is the more "powerful" language in terms of what you are capable of and perl is more cross functional - php really only a web scripting language ... then, why do i use php instead of perl?

    1. built in handling of form variables and cookies - yeah i know perl has "canned" routines than can provide for all the same jazz, but perl implemenations of these things always seemed clunky to me ...
    2. the database functions, although i realize they are platform specific functions - see above though for difference of "klunkiness" ...
    3. seems more of structured language to me (i realize this is mainly a subjective impression, nonetheless ...) - easier for me to read ...

    still, all said - if i was forced to use perl it would not be diesaster - just don't make me use asp or tcl or ... haven't tried python yet and have heard it is nice ...

    --

    AZspot
  74. haha ... downright "frightful" ... by Naum · · Score: 1

    ... it almost dissuaded (sp? - is that a word?) me from buying the darn thing, though that would have been a mistake as aside from the online sources listed here in other posts, it is, imho, the best php book out to date ...

    --

    AZspot
  75. Wow, you have same name as guy on the book cover.. by Naum · · Score: 1

    ... heh, seriously, thank you for the reply, downloading it now ... keep up the good work!

    hmm, all the php heavy hitters perusing these banterings ... rasmus, you, the phpbuilder.com crew, etc ...

    --

    AZspot
  76. Perl Sucks to maintain by codepunk · · Score: 1

    Perl has got to be the worst language I ever had to maintain. I convert every piece of perl code I have to touch as quickly as I can. I do not care who wrote it the perl language leads to ugly, unstable and unmainatainable code. Blow mod_perl out of your ass it is nothing but road pizza compared to php.

    --


    Got Code?
  77. Re:Is this page by mu_cow · · Score: 1

    Timothy needs to remove the following:

    </TD></TR></TBODY></TABLE>

    From the article source, just after:

    "The PHP Pocket Reference from Fatbrain"

    to fix the problem. Surely putting a Perl html validator into slashcode, wouldn't be hard. Oh but slashcode doesn't pass the w3 validator anyway...

  78. Re:Perl AND PHP on the same site? by mu_cow · · Score: 1

    If you just want a choice of either Perl or PHP for each page, it is (clearly) no problem. You just set up both and get them to handle MIME types properly, so that Perl pages are .pl and PHP pages are .php. BTW I find it much easier to use .php then .php3 or .php4 or whatever, you'll only regret it otherwise when you upgrade.

    I assume that you actually want each page to be parsed by both. I don't know how it 'should' be done, but I can think of a couple of hacky ways of doing it. Firstly, you could write a script that pipes the output of parsing by one interpretor into the other. However, this would lose the performance advantage of using the server modules. Instead, you could use this fun fact from the php manul:

    As long as support for the "URL fopen wrapper" is enabled when you configure PHP (which it is unless you explicitly pass the --disable-url-fopen-wrapper flag to configure), you can use HTTP and FTP URLs with most functions that take a filename as a parameter, including the require() and include() statements.

    Note: You can't use remote files in include() and require() statements on Windows.

    So as long as you aren't using windows (haha) you could include a .pl page from your server in a php document. Then the results of the Perl parsed page would get interpreted by php. You could then set the location of the .pl's as readable only by the local server, so that remote users would have to read the pages through php as well as perl. HTH.

  79. Re:Any advantage in PHP over mod_perl by mu_cow · · Score: 1

    I may have been told that PHP is lighter than perl, but that could be complete FUD. But surely it doesn't matter? IMHO the main cost in web development is developer time and ease of management. If you know the nuances of mod_perl, are happy with it and it does what you want, why change? There are very big web sites using both Perl and PHP that work - so clearly both are perfectly viable and will be around for a long time to come.

  80. Re:Perl AND PHP on the same site? by brystar · · Score: 1

    Its simple. Install mod_perl and then install mod_php. They are both just apache modules and have no problem being installed together. A php script has an extension .php or .phtml and a cgi script will have .cgi or .pl so a feel can't be both a php and a cgi script... which makes sense to me... Just follow the install instructions for php, it'll be okay. ~Bryan

  81. Re:My takes on these 2 books ... by Tobias_Ratschiller · · Score: 1

    Yep, but that's Murphy's fault. The knowledge repository application can be found at the Errata page of the book.

  82. Re:What about session management? by Tobias_Ratschiller · · Score: 1

    The book explains session management with PHP 4.0, and with the PHPLib. Besides an explanation of the concepts, it shows five (if I remember correctly) different ways of propagating the session ID from page to page.

    -Tobias

  83. Re:PHP vs Mason by Reality+Master+101 · · Score: 1

    Huh? In what way is PHP primative?

    Well, I have to admit I haven't looked at php in quite a while. In looking at it now, I have to admit that the language has improved dramatically since I last looked at it.

    Maybe to put the question another way, why would you use "yet another scripting language" rather than full-blown Perl, with all the various libraries, mod_perl, and all the huge amount of support?


    --

    --
    Sometimes it's best to just let stupid people be stupid.
  84. PHP vs Mason by Reality+Master+101 · · Score: 1

    I looked at php briefly a while back, and it looked like it was kind of like Active Server Pages, but the language was really primitive. I then ran across Mason, which is an ASP-like project except it uses Perl as the embedded language. I've used it in a couple of projects, and it's really, really cool.

    I guess my question is why would you want to use PHP with such a primitive embedded language, when you can have full-blown Perl?


    --

    --
    Sometimes it's best to just let stupid people be stupid.
    1. Re:PHP vs Mason by brlewis · · Score: 1
      I am a Java programmer by profession but am coding my new software in PHP. Why? Rapid development and flexibility

      If you aren't afraid of a LISP-like syntax, BRL provides rapid development and lets you use Java objects if you wish, though you don't need to know any Java to use it.

    2. Re:PHP vs Mason by the+eric+conspiracy · · Score: 2

      The lack of flexible quoting in PHP was always a real annoyance to me.

    3. Re:PHP vs Mason by the+eric+conspiracy · · Score: 2

      Huh? In what way is PHP primative?

      Depends what you compare it to. PHP is a worthy competitor to Perl. But compared to JSP it's strictly stone knives.

    4. Re:PHP vs Mason by the+eric+conspiracy · · Score: 2

      but am coding my new software in PHP.

      Right now my job consists of maintenance and adding functional extensions to a PHP based e-commerce site. It is a fscking nightmare because every page is full of creaping crud from the last 6 revisions. PHP IS fast to bring up, but it is hell to maintain after the first couple of rounds of revisions. And of course there is NEVER time or money to do that rewrite to Java. My life as a web developer is living hell because of the inadaquacies of PHP - and it's going to get worse because the only other fellow who understands the site quit last week out of disgust.

      PHP is fine for a small e-brochure site with minimal dynamic content. For anything more it is the path to HELL.

  85. Security for Newbies? by bejasus · · Score: 1

    RE: "all these books seem to be written for people who have had about 20 years of programming experience." I'm a corporate hack writer who learned HTML so that I didn't have to sit through one more meeting with a LAN administrator appointed "webmaster" who was armed only with a passing ability to operate Microsoft FrontPage telling me why something on our website HAD to be this way or that way. Surprise -- I found I enjoyed it. Soon I wanted to move beyond static pages, and began learning PHP/MySQL. I've played around with Perl, PostgreSQL, and Javascript, too, but on a more limited basis. Six months and several successful web projects later, this English major is beginning to understand and enjoy the programmer's view of the world. However, I'm still enough of a newbie to remember what I had trouble with. I think one of the "dangers" of PHP is that it is fairly easy to get quick results, but that means people like me who don't have a solid background in the technology are opening themselves up to security risks. For instance, it took me weeks and weeks to understand why my hosting company recommended using php cgiwrap, particularly with MySQL. Once I got smart, it was a shock to find out that php cgiwrap doesn't work with their SSL service . . . . which seems to leave my secure pages more at risk than the unencrypted pages. Although I've benefitted from all the websites and books mentioned above (as well as Julie Meloni's PHP Essentials), what I've found most lacking is good information on security issues for people like me, would-be web application developers who don't have a good technical grasp of networking and webserver technology. Most of the books and tutorials throw in a brief section about security, but only after lines and lines of coding examples that don't address security issues at all. Anyone got a recommendation on a good resource that provides a strong introduction to security for people who come to web programming from -- um -- the liberal arts, rather than computer science?

  86. pocket reference is online by aint · · Score: 1
    It's true, part of the Pocket reference is online here :

    http://www.oreilly.com/ca talog/phppr /chapter/php_pkt.html.

    -- .sig --

  87. Awesome Book by Enoch5:24 · · Score: 1

    This is really the best book on PHP I've found. I like the authors' approach to the subject, and the way the material is presented. It's very useful to just about anyone writing a web page these days.

    --
    "You seem like a decent fellow. I hate to die." - The Man in Black, from The Princess Bride
  88. Re:O'Reilly by ZanshinWedge · · Score: 1

    The O'Reilly book is only a small handbook, and it's for PHP3 anywho. O'Reilly (unfortunately) doesn't have any "real" books on PHP.

  89. review of Professional PHP Programming by p4r4d0x · · Score: 1

    I also enjoyed this book; if you'd like my opinion you can check out my book review on dotcomma. </self-plug>


    __

  90. Re:wtf? by Xoro · · Score: 1

    They demonstrate why you should be programming in php rather than perl (like slashcode is)

    Slashcode may be written in perl, but it runs on mod_up_perl...

    --
    Kill, Tux, kill!
  91. I Agree by syf0n · · Score: 1

    I have to agree -- I'm a web designer,(professional) and I find it very hard to pick up jobs unless I can code not only the HTML (and design the graphics), but know quite a bit of java, vbscript, and (as with my current job) know some Oracle programming for the server at work. Companies figure they can't kill two birds with one stone if they hire one person that has the skills of two -- it's just more efficient that way, but creates a real challenge for people who just fancy themselves as artists!

  92. O'Reilly by AbbyNormal · · Score: 1

    Does anyone know if O'Reilly has anything out like this? If so, is it better than these books that are listed?

    **hiden motive on** Must find more Online books **hide motive off**

    --
    Sig it.
    1. Re:O'Reilly by AbbyNormal · · Score: 2

      Yep...saw the O'Reilly after I posted. My bad.

      Hmm. That's a shame. I've come to trust O'Reilly as being very informative...the only book that they made that I DID NOT like at ALL, was their Curses library one. Boy did that NOT have any relevant information in it.

      --
      Sig it.
    2. Re:O'Reilly by ackthpt · · Score: 2

      Um... Try this link
      Gottum book, related books and some discussion links.

      When in doubt, just surf over to http://www.ora.com

      Vote Naked 2000

      --

      A feeling of having made the same mistake before: Deja Foobar
  93. Re:I really like this PHP book by sumengen · · Score: 1

    It is very funny that this book is totally missing basic character-based functions of php, which you need to write any advanced web application. The authors obviously never worked on a real life complex php site. It was good reading about LDAP, xml, etc. Ddn't anybody else (who tried to learn php from this book and write a complex program) notice the same thing that you get stuck at one point...

  94. Why buy a book on PHP? by Anonymous Coward · · Score: 2

    I was evaluating middleware trying to figure out what direction I wanted to take and came to the conclusion that PHP was the best alternative for me. People will argue on and on about what they perceive to be the best technology to get the job done. In the end it comes down to getting the job done and feeling comfortable with the tools you use to achieve that goal.

    I live in the thick of things so there's the ubiquitous B&N jam packed to the gills with two-inch thick books on almost any language/software you can think of. I picked up two books on the subject: PHP Programming (Wrox) and the PHP Pocket Reference (O'Reilly).

    Why did I pick up these two books?

    The Wrox book:
    The five geeks on the cover of the Wrox book was a real attention getter. The fact that it didn't come with a CD was another deciding factor. I am just plain sick of books with CD's these days. Mainly I bought it because I ripped it open and read the TOC and it looked like the better of the three two-inch thick $50 books I was looking at. Later I have come to find, after reading a ton of reviews, that it was a good choice.

    The O'Reilly book:
    What? like I'm not going to buy a book written buy the guy?

    The only gripe I have is that it's not a two-inch thick $50 book with CD!!! ;^)

    It fit's nicely in my back pocket, thank you very much, and has replaced my much tattered and well read copy of "The Catcher in the Rye"

    You will always find the most current information on-line, but you'll have to look for it. Having the information in book form means it's all in one place and doesn't require fresh batteries.

  95. learning php by CLorox · · Score: 2
    I have found that for me, some of the best resources for figuring out php lie at php.net's own site. The samples provided by many of the php users worldwide have proven more than helpful and helped me code my first complex app in one day. I suggest that if you care to learn it, you may want to look at the site and try it out before you sink another $35 on a book you may only use for reference once every 6 months. If your not picking it up quickly then by all means hop on down to the nearest Borders.

    Searchable websites seem to be a little quicker than the index.

  96. What about session management? by dangermouse · · Score: 2

    I have yet to find a book that really gets into session management. At least one that I've seen does mention that such a thing exists in PHP4, but that's about it. I'm interested in seeing techniques used for handling logins, etc., and in seeing samples and examples of session management in use.

    Everything else I've needed to know, the php.net manual has told me.

  97. Re:The Advances of PHP Documentation by YogSothoth · · Score: 2

    ack, I mean of course 'error_reporting' not 'error_handling'. Ah well, since I'm responding to my own post here's some more sample code:

    <?
    error_reporting(E_ALL);
    $var = "foo";

    print($vra . "<BR>\n");
    ?>
    Without the error_reporting(E_ALL) you get nothing but with it you get:

    Undefined variable: vra in /home/jdumas/public_html/test.php on line 5.

    Just what your looking for eh? Also, php4 has a (largely undocumented as far as I can tell) 'assert' function that is a big win, you can do stuff like this:

    <?
    function expectsAnEvenNumber($theNumber)
    {
    assert('$theNumber % 2 == 0');
    print("The number: $theNumber<BR>\n");
    }

    expectsAnEvenNumber(3);
    ?>
    Which outputs:

    Warning: Assertion "$theNumber % 2 == 0" failed in /home/jdumas/public_html/test.php on line 4

    --
    there are two kinds of people in this world - those who divide people into two groups and those who don't
  98. Mee Too! by crisco · · Score: 2
    I've benefitted greatly from this book also. I've since recognized some of the authors posting articles and information to the various PHP tutorial sites, indicating that they are aware and involved in the community surrounding PHP.

    Table of Contents

    I. Introduction 1. About this book 2. Downloading, installing and configuring 3. Programming in a Web Environment II. The Language 4. Variable and data types. 5. Operators 6. Expressions and statements 7. Functions 8. Arrays 9. Objects and OOP 10. String manipulation and regular expressions III. Advanced PHP 11. Non-relational databases 12. SQL DBMS engines 13. Using LDAP 14. Serving XML documents 15. Graphic content creation 16. PHP connectivity 17. Sending E-mail 18. Cookies 19. Error handling and debugging 20. Security issues 21. Magic with quotes 22. Templates IV. Sample Applications 23. A shopping cart application (Databases, ookies) 24. Phorum Case Study (Security) 25. E-mail Case Study (E-mail) 26. Metalloprotein Case Study (Databases) VI. Appendix PHP4/Zend Function Reference

    As you can see, this book predated PHP4/Zend, but the material still very much applies. PHP4 didn't change the core language very much at all and goodies like the Zend compiler only extend the capabilities, not really change them.

    I wondered for a while "why buy a book when there is so much good stuff on the web". Aside from the obvious, like being able to read while sitting on the porcelain throne and having a dead tree reference handy at the computer, having a well written book like this gives you most of the matierial you need in one spot. It cuts down on rummaging through your bookmarks, going from one PHP site to the next searching for that article you read two months ago.

    So, if you get the chance, go down to the local bookstore and peruse all these books and take a look to see which might be most useful to you. The first one mentioned in the review (Web Application Development with PHP 4.0) sounds pretty good, at least worth a look.

    --

    Bleh!

  99. Way Offtopic [was Re:Offtopic] by luge · · Score: 2

    karma cap? eh? My karma dropped from 70+ to 49 several weeks ago, and I never could get a response from Taco as to why... obviously, though, it's not a hard cap, if it can still stay at 120+. Anyone have details (or pointers to which &sid thread I can find more details in?)
    ~luge

    --

    IAAL,BIANLY

    1. Re:Way Offtopic [was Re:Offtopic] by luge · · Score: 2

      Heh. Whatever- I mean, not like I post all that often anymore, and 50 or 250 I still get a bonus, so even if you think of it as a "30% dropoff!" it's still not a big deal. Just really irritating never getting a response from the /. people when I said "WTF?" So, keeping this thread alive: Anyone? Anyone? Explanations? Thoughts? sid links?
      ~luge

      --

      IAAL,BIANLY

  100. Errata: Rasmus by Pac · · Score: 2

    Where it reads "Ramus", it should read "Rasmus".

    Since we are here, where it reads "more useful for Web programming in the Web" it shoud read "more useful for Web programming" or "more useful for programming in the Web", but not both. :)

  101. You will hardly lose points moderating up by Pac · · Score: 2

    "In fact, metamoderation encourages moderators to moderate conservatively since trying to champion an unpopular opinion is likely to lose you karma points in the metamoderation phase."

    I have never had this experience. I can't confirm this alone, but I think most people metamoderate the way I do: Give an "a priori" Fair to all positive moderation, pay attention to the comments moderated down to see if any prejudice/persecution/plain stupidity
    was the real reason behind the negative moderation.

    1. Re:You will hardly lose points moderating up by Pac · · Score: 3

      The moderation guidelines says clearly that moderators should be more concerned about moderating up than down. Also, I never said the opinions or moderations I metamod as fair were "restating of my own, sheeplike, beliefs". First, aside from a small tendency to flee when I see a wolf coming in my direction, most of my beliefs are hardly sheeplike. Second, I think I haven't made myself clear. I metamod ALL positive moderations as Fair. Never or almost never read the comments they refer to. So I don't have the faintest idea if they restate my beliefs (sheeplike or not). On the other hand, I look very carefully at the negative moderations. Many times I even open the comment thread, to understand both the comment and the moderation. I really believe that a false positive is better than a false negative (and a false positive tend to be corrected far more frequently than a false negative).

  102. You can always discuss it somewhere else by Pac · · Score: 2
  103. the moderation system is a failure by tuffy · · Score: 2
    I would also like to point out that improving slashdot is not just a matter of metamoderation and moderation, it is a matter of generating intelligent discussion through posting insightful/informative/whatever comments. If no-one sees these because your karma is negative, it detracts from slashdot. Obviously there is no easy answer to finding the right balance.

    You are correct. Unfortunately, the current system has done very little to improve the state of Slashdot discussion. In fact, I believe it has proven detrimental and needs nothing less than a complete overhaul - or be scrapped entirely.

    Take the anonymous trolls, for instance. Not only are they still present, but they have become such a nuisance that reading articles at level 0 or less is almost a waste of bandwidth. Anyone wanting to honestly submit an anonymous (or unpopular) opinion isn't going to be heard unless moderators intervene to raise it a few points. And downgrading troll posts has not deterred them in any way from making yet more posts - since the amount of posts a troll can make is basically infinite but a moderator only gets five points to work with at a time.

    Not only that, but moderators haven't improved discussion by moderating posts up, either. Part of the reason for this is that posts that are inflammatory or simply telling an unpopular opinion aren't going to be moderated to the same levels as another post that just parrots what most everyone else already believes. In fact, metamoderation encourages moderators to moderate conservatively since trying to champion an unpopular opinion is likely to lose you karma points in the metamoderation phase. The end result is no reward for going outside the Slashdot mainstream but plenty of grief.

    As it stands, Slashdot has degenerated into a sort of "karma game"/popularity contest that does little to further discussion into anything interesting but plenty to dumb the whole site down into a sort of love fest, which is something of a minor tragedy considering the potential.

    --

    Ita erat quando hic adveni.

  104. Re:Any advantage in PHP over mod_perl by Dr.Dubious+DDQ · · Score: 2
    Is there any advantage in playing around with PHP?

    This part I think I can safely say "yes" to. I've not played with mod_perl specifically, but having done some work with both PERL and PHP (caveat: I'm nowhere near an "expert" with either one!), PHP seems to have a better 'feel' (subjectively) working with web-interface stuff than PERL does, though it (PHP) seems fairly similar to PERL in style and syntax.

    Mind you, I'd definitely put myself in the "advanced beginner" ("Beginning intermediate?") category as a coder in PERL or PHP, so more experienced coders may have a different view.

    (On yet another hand - to any fellow amateurs reading these posts: PHP definitely seems less complex than PERL [which obviously means it's a bit more limited, too] but has a similar style, so it might make a good adjunct to PERL studies...)

    Any more experienced coders out there agree? Or am I nucking futs?


    Joe Sixpack is dead!
  105. Re:Any advantage in PHP over mod_perl by Hanno · · Score: 2

    When it comes to installing it, PHP beats mod_perl quite easily. Also, PHP is available on more platforms and most providers install it as default these days.

    (This by a guy who prefers mod_perl.)

    ------------------

    --

    ------------------
    You may like my a cappella music
  106. Re:The Advances of PHP Documentation by plunge · · Score: 2

    Uh, it is- under manual as "error," as well as being prominetly featured in the php config file.

  107. Re:Well, GOOD web sites still use just those few t by extrasolar · · Score: 2

    "And the best web sites are still the ones that stick with just the basic HTML tags..."

    Sad. HTML has some really nice semantic tags like <ACRONYM> and <ABBR> that even professional web designers never use.

  108. Re:Is this page by TheTomcat · · Score: 2

    A few years ago, knowing just a few html tags and tricks could probably have gotten you a job as a full-fledged Web designer, or at least Web coder.

    Ironic that the very page on which this appeared, the story author screwed up the HTML (-: Looks like someone forgot one, or closed one too many TABLEs, TRs or TDs, thus screwing up anything below the error. Don't you guys have a 'preview' for story submissions, before they go live? (-:

    Note: I'm not trying to troll here, just pointing out the irony.

  109. Offtopic by Fleet+Admiral+Ackbar · · Score: 2
    Has anyone else noticed that, in the metamoderation, you can gain karma by agreeing with some moderation, and lose by disagreeing?

    I metamodded the other day, saw something that I thought was extremely unfairly modded, and lost two karma points for it.

    Fug, I'll lose karma for this too, but in the end, who really cares?

    --
    Carefree highway, let me slip away on you.
  110. Replies by McSnickered · · Score: 2

    As a reply to several comments:

    1. Yes this page is rendering strangely.

    2. I haven't seen other O'Reilly books on PHP other than the pocket reference. However, the O'Reilly book MySQL/mSQL does devote some good chapters to PHP 3.0 & mod_perl.

    Book Warning: 'Php3 : Programming Browser-Based Applications' by Medinets is one of the least helpful books I have ever purchased. If you're interested in combining PHP & MySQL, I'd recommend getting both the Wrox book and MySQL/mSQL.

    --
    They call me the working man. I guess that's what I am.
  111. idea for book proposal by eries · · Score: 2

    I've been shopping around a book proposal to several publishers about a more narrative-style (and highly real-world based) book on PHP+MySQL based on m experiences with the Enzyme open-source project (http://enzyme.sourceforge.net). The proposal itself used to be available online at kuro5hin.org, but after the DDoS, it's no longer available. I'd be curious if anyone has ideas about this area, and if they'd like to take a look. Basically, I think most of these existing references on PHP are not that useful. I want to create something that will take a reader from zero db/php knowledge all the way up to creating a major app, using 100% real-world examples. And when I say zero knowledge, I don't mean a beginner - I just mean an advanced programmer who hasn't dabbled in web/db programming yet.

    What'ya think?

  112. Re:Any advantage in PHP over mod_perl by Bassthang · · Score: 2
    At the risk of starting a flame war, here goes:

    Advantages of Perl:

    • Perl can be used for tasks other than web scripts. Why learn a new language for every task?
    • Perl does OO fairly sensibly. Hence not all perl code has to be a tangled mess. Get Damian Conway's book on this.
    • Ease of code reusability. Modules. CPAN. Etc., etc.
    • Syntax. The PHP concept of a 'global' is just fubarred.
    • Integration with OS. PHP's idea of what 'system' and 'exec' should do is brain damaged.
    • Bodged REGEXP implementation
    • Perl can generate HTML, or you can embed it in phtml. Your choice.
    I could go on. It is certainly easier to get PHP working than mod_perl. But perl scripts can also be run as simple CGI's, not in mod_perl, so that isn't a huge hurdle. Hell, you can run your CGI scripts at the command line for testing them.

    I'll let someone else say why PHP is better ...

    (Is it just me, or does every site that uses PHP have rounded edges everywhere, just like php.net?)

    --
    "What I look forward to is continued immaturity followed by death."
  113. Re:Publishers who include CDs ... by Pfhreakaz0id · · Score: 2

    Two words: Wrox Press (www.wrox.com)
    ---

  114. I really like this PHP book by glanois · · Score: 2
    Professional PHP Programming from Wrox.

    Can anyone draw a comparison between the books Danny reviewed and this title?

  115. Re:Advantages to PHP over Perl? by chegosaurus · · Score: 2

    First off - my PERL is rubbish, but I've been using PHP since 2.0beta.

    Seems to me the speed of mod_perl and PHP is effectively equivalent. If you're doing a lot of hard work with a database then the bottleneck is never in the query or processing the data, it's in rendering a great big table in the user's browser.

    One may be faster than the other (my money is tentatively on PHP because it's so much more lightweight and written solely for the task) but I think any benefit is lost in either shoving the data down a wire to the client, or the client working with that data.

    I'm more comfortable with PHP, so I use it. It's as simple as that.

  116. Re:Any advantage in PHP over mod_perl by Metrol · · Score: 2

    date functions suck in PHP

    Dates work just peachy in PHP, you just haven't taken the time to learn how to convert them. I would highly recommend NOT storing Unix timestamps into your db, as then you aren't able to utilize SQL statements that can break out months, days, or years effectively. The following is a quick function I keep around for doing MySQL to PHP date conversion.

    // PHP and MySql store dates very differently. This routine converts
    // a MySql date format into a Unix timestamp so PHP can use this to
    // format in it's date functions
    function GetUnixDate($XDate) {
    $DateParts = explode("-", substr($XDate,0,10));
    $TimeParts = explode(":", substr($XDate,11,18));
    $UnixDate = mktime($TimeParts[0],$TimeParts[1],$TimeParts[2],$ DateParts[1],$DateParts[2],$DateParts[0] );
    return($UnixDate);
    }

    Limits your dates to 1970-2032

    Actually, the limit is 2038, and this is not a PHP related thing. Unix runs out of time on (I believe) Jan 18th, 2038.

    --
    The line must be drawn here. This far. No further.
  117. Re:Any advantage in PHP over mod_perl by Metrol · · Score: 2

    Is there any advantage in playing around with PHP?

    There is one over all aspect to PHP that sets it apart from pretty much every other programming language used on the web. It's the only one (that I am aware of) that was actually written specifically for the web. To either appreciate this or hate it you'd have to work with it for a while.

    --
    The line must be drawn here. This far. No further.
  118. Do you know PHP? by Grasshopper · · Score: 2


    Why yes, sir. It's pretty hard programming.

    Do I get the job?

    --
    Source code is a lot like a parachute; it needs to be open in order to function properly.
  119. My takes on these 2 books ... by Naum · · Score: 2

    ... I own both books - the pocket reference is nice but even at time of publishing it was out of date as it does not include many of the PHP 4.0 constructs/functions (i.e., array functions ...) ... what would have been cool is that if they took the appendix in WROX Professional PHP Programming and made it the "little reference" - as it is more complete and includes ver 4.0 updates ...

    In regards to the New Riders Web Application Programming - it is a decent read - like the story author here, I just scanned over the chapter (one of the more lengthy ones on "rolling" your own PHP in C ...) - some of my disappointments -, though, was the reference to source code for a knowledge repostiory application in one of the chapters - the accompaning CD had a source code directory, but no knowledge repository application like stated in said chapter - I even sent email to publisher via their little feedback box and I got a response that said see the *source* directory ... duh! it ain't there Wilbur ... another was that, imho, coverage of some essential intermediate-advanced topics was just "glossed" over, and nothing of real substance provided ...

    still, more content and substance than could be found in any Que or programming for retards book ...

    --

    AZspot
  120. Web Design Fragmentation by Phibian · · Score: 2

    "A few years ago, knowing just a few html tags and tricks could probably have gotten you a job as a full-fledged Web designer, or at least Web coder. As things get more complicated and Web sites more dynamic, the tools you need to create that all-singing, all-dancing user-interactive content have gotten more complex than carets and single letter tags"

    Has anyone else noticed that the field is becoming fragmented? Just as graphic design for the web is really starting to take off in colleges and universities, the scripting required to get a complex web site up and running is starting to resemble bonafide programming - and is beyond either the technical or interest comfort zone of many graphic design folks.

    And many content providers have long had nothing to do with the actual design but don't want anything more technical stuff like sticking it on the web site - be it adding to some database or actually modifying the HTML.

    More and more, I see web design having three parts to it - the content - the gui - and the programming to put it altogether.

    My experience has been that people with little HTML expertise (especially dynamic-type web stuff) still have no trouble finding jobs. Not everyone has to implement their web site ideas - there is room for pure design. Unfortunately, if you then have to work with someone without the ability to implement their ideas, some of those ideas are going to be real *fun* to implement...

  121. Any advantage in PHP over mod_perl by ibot · · Score: 2
    I am already familiar with writing perl scripts and understand some of the nuances of mod_perl programming.

    Is there any advantage in playing around with PHP? Basically, are there certain situations where PHP is clearly superior to mod_perl/perl?

    Founder's Camp

    --

    Founder's Camp
    News for non-Nerds. Stuff that matters.

    1. Re:Any advantage in PHP over mod_perl by Rasmus · · Score: 3
      Just a couple of comments. There is no additional overhead involved when using Perl-style regular expressions in PHP. In fact, for most things they are actually marginally faster than POSIX-style regular expressions.

      I agree, the leak() function is cool:
      User: Wha! My script is leaking memory!?
      Dev Dude: Don't call the leak() function.
      User: Oh yeah, thanks.

      You can also include a module in PHP without recompiling. For example, let's say you install Apache, then install PHP (as either a static Apache module or as a DSO) and then you suddenly need to add MySQL support. You can go into your PHP source directory and do: ./configure --with-mysql=shared and it will make you a mysql.so file. This file can be loaded by an individual script using dl('mysql.so'); or it can be loaded globally by putting: extension=mysql.so in your php.ini file.

    2. Re:Any advantage in PHP over mod_perl by mcrbids · · Score: 3

      Dunno.

      Some time back, I figured I'd pick up Perl - it being the "standard" language - and immediately got lost. I tried two different books, as well as an online howto, and got NOWHERE.

      PHP, on the other hand, I picked up pretty much immediately with just the phpbuilder site and php.net. At the former site, people were very helpful and I was producing something meaningful (almost) immediately!

      I liked it so much I sold my business (computer shop) and now work as a Web developer. (Currently building a full-fledged auction site!) It's fun and rather straightforward.

      Couple of caveats:

      1) Mixing PHP and HTML sounds nice, (and is for tiny projects) but for any project of any size, you want to implement and use templates from PHPLIB or FastTemplate classes. Otherwise, you get overwhelmed trying to keep track of what it's supposed to look like and what tags and blah blah blah.

      2) For mid-to-large size projects, USE OOP!

      3) date functions suck in PHP. When saving a date
      in a database, don't bother with fancy date functions, as PHP uses 32 bit integer *nix epoch internally to calculate dates - just save the date as an integer and work from there. Limits your dates to 1970-2032, but it's at least consistent since you aren't going from Integer -> db date format -> integer -> final output, you are instead going Integer -> integer -> final output, and PHP can't handle dates outside this effectively anyway.

      4) Rather than write for particular database, (Postgres/MySQL) or even to ODBC (which can create driver headaches) write to a generic "db" class you write yourself - and then make that class manage the database. That way, porting to another platform is as easy as updating that single class.

      Not sure why I'm telling you all of this - but take it for what it's worth.

      -Ben

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    3. Re:Any advantage in PHP over mod_perl by Rasmus · · Score: 5
      • PHP can be used for other than web scripts. But you are right, it is definitely geared at web stuff.
      • PHP's OO option has been improving steadily and I personally don't think it is all that bad. I never could figure out Perl's OO stuff.
      • We are working on that with PEAR. See the pear/ directory in the PHP 4 distribution.
      • global is fubarred. Yeah well, personal preference here I guess. I take full responsibility for this one. I had just gotten home from a 20-hour debug session with reams and reams of C code printed out on an old dot-matrix printer. The problem turned out to be a variable in a function that was meant to have local scope stepping all over a global variable. I swore I would never have this problem in PHP and implemented the "declare your globals" feature right then and there.
      • system("ls /some/dir"); The result is a listing of /some/dir in your web page. Seems pretty sensible to me. What's your beef on this one?
      • Bodged? PHP supports two styles of regular expressions. POSIX 1003.2 regular expression through Henry Spencer's regex library and also Perl-style regular expression through the PCRE library. You are saying these libraries are broken? I personally think Perl-style regular expressions are horrible. Try counting all the different ways the '?' character can be used sometime. I have counted 15 different meanings for '?' and I am sure there are more.
      • PHP can generate HTML or you can embed it. Your choice.
      And yes, you can run PHP scripts from the command line as well. It is as simple as: php script.php You can even stick the command-line PHP parser alongside perl in /usr/local/bin and write standalone PHP scripts that have #!/usr/local/bin/php on the first line. I am really not trying to convince anybody to dump Perl for PHP. If you know and love Perl, I suggest sticking with what you know.

      We have a bad habit in the open source community of beating up on each other. Linux and FreeBSD users fight, Emacs and vim users fight, Gnome and KDE users fight. Perl, PHP and Python users fight. When it comes down to it, these different open source systems are much more alike than they are different and we are not helping ourselves by being overly critical of each other. Constructive criticism and code sharing will ensure the technology advances. Infighting and destructive criticism will ensure that we will drag our old and grey beaten bodies to CompUSA to plop down $400 for an update to Windows-2005 and another $250 for that fix to C# that makes it stop eating all available RAM on a simple database query. -Rasmus

  122. Online Books? by SUWAIN · · Score: 2
    As much as I love computers... You can give me a free account to an "eBook", but I am still probably going to run out and buy the book. (Assuming I'm interested in the book in the first place...)

    Why? There are some advantages to a printed book that you just can't get online.

    First, you don't hurt your eyes by reading a book (unless you do something odd, liking trying to jam the book into your eyball).

    You can highlight, circle, scribble, etc. a physical page. This has unsploken advantages.

    A large heap of of books next to your desk is a way of showing knowledge. 20 100GB hard drives overflowing with data is a way of showing that you have a hard time managing data... (Okay, so I don't know anyone with 2TB of books.)

    By the way, all these books seem to be written for people who have had about 20 years of programming experience. I am fairly new to the programming world. Are there any good books that introduce PHP to someone who knowns practically nothing about what PHP is? I am interested in using PHP/MySQL on my site (still under development), but know nothing but a little HTML. (And shell scripting). Can anyone recommend anything helpful to beginners like me?

    ...............
    SUWAIN: Slashdot User Without An Interesting Name

    --

    ...............
    SUWAIN: Slashdot User Without An Interesting Name

  123. Advantages to PHP over Perl? by tzanger · · Score: 3

    This isn't meant as a flame or to start a flamewar... This is a valid question I have regarding the two languages and their place.

    Perl (mod_perl to be exact) is a huge behemoth. But it allows me to reuse the code I've created over the years to be reused outside of the web realm and without a special "wrapper" program -- just Perl.

    I've heard all kinds of people say that PHP is faster... Than perl under mod_perl? I haven't been able to find a decent real benchmark for either. I've coded in PHP, and I've coded in Perl. They both "feel" pretty much the same to me and seem to run just as fast (most of my code is just formatting the output of database requests, since I optimize all the requests themselves instead of pulling in vast reams of information and sorting it in the web server. I don't want to keep two languages just hanging around which seem so similar, as I don't seem to see any kind of advantage to one over the other in the web realm.

    Does anyone have any experience or a real-life style of benchmark which would help convince me that PHP is a good thing to keep around even though Perl seems to do most, if not all, of what PHP does and at the same speed?

    Again, this is NOT intended as a flame. Seems like a good ontopic post for this particular story though...

  124. Re:Publishers who include CDs ... by Genom · · Score: 3

    Actually, I find that having the full text of the book in some easily searchable format on a CD is a GREAT help.

    The New Riders book reviewed above has just such a CD (with the book in searchable PDF format) - I leave the hardcopy at home for reference there, and leave the CD at work -- having a copy at each location without having to lug the book back and forth or buying another copy of a relatively expensive book (let's face it, programming books ain't cheap!) is EXTREMELY handy.

    I could care less what else is on the CD.

  125. Re:The Advances of PHP Documentation by Azog · · Score: 3

    I've been doing a lot of PHP programming over the last two months. Before that I had a lot of experience programming in C++. I think PHP is great. I'm really looking forward to using PHP 4, with the optimizers and precompilers.

    I mostly use the online documentation, but I've got the pocket reference by Rasmus Lerdorf. It's pretty helpful once you know the basics, but you probably wouldn't want to learn PHP from it.

    One thing that I would like to see covered in the books is PHPLIB. I used PHPLIB for my last project, and man, does that stuff rock! It has very useful code for sessions, authorization, database access, query and table widgets, and more.

    You see, one of the problems with doing a nice web app is that HTTP is a stateless protocol - the server gets a series of requests, but doesn't track the flow of the user from one page to another. PHPLIB fixes this with sessions: as long as the user is on the site, they have a unique session ID. Even better, session variables can easily be stored from one page view to the next, and this is nearly automatic. It allows you to forget that HTTP is stateless!

    The object oriented design of PHPLIB is pretty good too - I've subclassed the table and query widgets without too much trouble, although PHP has some limitations with inheritance that are a little annoying. (A subclass that overrides a method can't call the implementation of that method in the base class - or at least I don't know any way to do it.)

    My only major complaint with PHP is that variables are created implicitly. This is convenient for small scripts, but sucks for complicated applications, since typos in variable names don't cause parsing errors, they just get created as empty variables. On a related note, global variables have to be declared as global inside functions. If you forget, you just get another empty local variable. Similarly, member variables of objects must be referred to as $this-&gt somevar in methods. That's fine, but if you forget - whoops, no error message, just another new, empty variable.

    I'm hoping PHP4 will have an option for requiring explicit variable declarations. That would make PHP nearly perfect.

    Torrey Hoffman (Azog)

    --
    Torrey Hoffman (Azog)
    "HTML needs a rant tag" - Alan Cox
  126. Publishers who include CDs ... by alkali · · Score: 3

    ... in books on web development should be forced to eat them. Anyone developing for the web is going to have a net connection by which they can obtain a fresh copy of anything they need (even a 56K modem will usually do in a pinch). Instead, the prices are jacked up by $10/unit and we're stuck with some worthless plastic that makes the back cover unwieldy. Grrr...

  127. Web App. Development With PHP 4.0 -- Fantastic by waldoj · · Score: 4

    I actually sent a fan letter to Tobias Ratschiller, I love this book so much. I must confess that I'm only halfway through, but it's really get to see a guide to programming style in PHP, my favorite language. I recommend it highly to anybody that's looking to do PHP professionally.

    What I *would* have liked to see in this is more background information on OOP. I've never worked with OOP, so I feel at a bit of a disadvantage. But I'll brush up elsewhere, I guess, but I wish that this would have been included.

    Still, this is the #1 PHP book out there, and I can't recommend it more highly. Get it.

    -Waldo

    -------------------

  128. With PHP, it's pretty much RTFM by revbob · · Score: 4
    I've done quite a bit of PHP3 and MySQL, and apart from a few runs to places listed on the PHP links page and PHP FAQts, I've pretty much gotten everything done with the excellent HTML manual.

    About the only thing the manual lacks is an index of functions, but a little bit of experience is generally enough to help you figure out the category under which they've hidden the function you're looking for. I see now that the PDF version of the manual is indexed, so newbies to the manual may want to start there.

    OTOH, I'm a long-time C programmer, and when I wondered about syntax, pretending that PHP is C with dollar signs in front of the variable names has worked out more often than not.

    Since this page is (presently) screwey and I can't figure out how to reply to an individual posting, in answer to "why PHP instead of Perl?", why not? Oh, all right. Here's a couple of reasons:

    • PHP runs in the context of Apache (except the Windows version) which makes it outrageously fast on the UltraSPARC II I'm using most of the time, but then so does perl if you use mod_perl. You'll notice I said nothing about "X is faster than Y". I've found PHP/MySQL to be "very fast" in my applications, and let's leave it at that.
    • PHP has got excellent integration with databases (especially MySQL), but I imagine something similar is available for perl.
    • PHP is smaller than perl, which means that a PHP mod Apache won't have anything like the footprint of a mod_perl Apache (good to know when you're paying Sun's memory prices)
    • There's nothing remotely similar to CPAN, and the Free PHP apps I've seen out there aren't that useful, which means that if you're writing PHP, you're probably doing it mostly from scratch rather than extending others' apps. I actually find this useful. I figure if you're doing server-side scripting, speed is the number-one virtue, and reuse -- at least the kind of reuse I've done -- usually incurs a speed penalty.

    So if I were buying a PHP book, the first thing I'd look for are applications that are like the application I'm building to see if I could steal some ideas and code snippets. And I'd look for stuff about the big picture that the originators sometimes forget to put into their documents. But I'm not in the market for a PHP book because the manual is so good and because years in the salt mines of C have pretty well taught me how to code a solution to a problem.

    Let me hit on one more thing if I may. When you read the source code, you're reading the truth. When you the canonical documents (the language spec or the documentation supplied with the language) you're one step away from the truth. When you read a textbook, you're two steps away from the truth.

    I'm generally too lazy to read the source code (not always -- that's how I learned Unix networking, but there were some special circumstances there or I'd just have read a book like a sensible person), but I've been bushwhacked by enough documentation bugs to do as much learning as I can from the canonical documents.

    YMMV, of course.

  129. The Advances of PHP Documentation by Pac · · Score: 5

    A few years ago, when I started using PHP (somewhere between versions 1.x and 2.x) for professional web programming, the sole sources of documentation were a tiny manual written by Ramus himself (the same Ramus of the second reviewed book - the reviewer fails to note that Ramus Ledorf was PHP primary creator and maintained it almost by himself until the 3.0 effort) and the mailing list.

    It was pretty hard to understand some features without delving in the C source (incidentally, PHP is one of the most well behaved coding efforts I have seem to date. The 1.x,2.x and 3.x sources compile without a flaw in almost any flavour of Unix, and I say almost because I haven't tried them all).

    Nowadays, besides the wonderful online documentation, you have lots of books (9 available, 12 coming soon, according to Amazon). It is an easy world.

    If you are looking for a place to start, the site is certanly this place. If you need a book, try Core PHP Programming. For a deeper look, Professional Php Programming seems to be the way to go.

    And, the reviewer opinion notwithstanding, buy Ramus book and let it rest beside K&R, Wirth and Stroustrup books for a while. Not exactly Ramus league, but PHP is more useful for Web programming in the Web than C,C++ and all Wirth languages combined.

  130. annoted manual at php.net rules by MattW · · Score: 5

    Php.net has an excellent docs section, and I learned to code php and set up a fairly major site from scratch just reading their annoted manual. I will say, if you're new to php, try to read through each section even if you don't THINK you'll need it. There's so many goodies built in, you're bound to miss some. Also, the annoted manual is good because the users offer some clever uses of many pieces of code, or good ways to do things like parse form inputs en masse for illegal characters, or whatever.

  131. I've stuck to online resources by mu_cow · · Score: 5

    These books may be useful, but mostly everything I have needed has been online. The PHP manual is pretty comprehensive and easy to navigate. If you do not have it, download it now!

    I have found a lot of help on http://www.phpbuilder.com/ this has a lot of source code, configuration help and helpful forums. From just these two sources you could certainly produce something of slashcode complexity if you have some programming experience.

  132. Everythings Online by tupawk · · Score: 5
    There really is no need for a book on PHP. I taught myself totally from scratch using online resources. Here is a short list of the ones I found most useful:
    • PHP - This is the site that started it all. Make sure to check out the documentation section.
    • Webmonkey PHP Tutorial - This site is great for getting started with PHP and MySQL.
    • PHP Builder - My favorite site about PHP. Lots of good examples and a great message board for all your programming needs!
    • Zend - This site is a great portal for more PHP resources.

    Hope these sites help out.

    --
    "it could just be the midgets. You've got to be careful with midgets in Spandex." --Jamie Richardson