PHP Hacks
Tips & Tools For Creating Dynamic Websites
Publisher: O'Reilly Media
Released: December 2005
Pages: 468
Description
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Recently Viewed
VoIP Hacks
By Theodore Wallingford
December 2005
Ebook: $23.99
Print & Ebook: $32.99
Print: $29.99
Unicode Explained
By Jukka K. Korpela
June 2006
Ebook: $47.99
Print & Ebook: $65.99
Print: $59.99
Open Source for the Enterprise
By Dan Woods, Gautam Guliani
July 2005
Print: $22.95
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyPHP Hacks
 
4.1

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (4)

  • 4 Stars

     

    (3)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (1)

100%

of respondents would recommend this to a friend.

Pros

    Cons

      Best Uses

          • Reviewer Profile:
          • Developer (3)

        Reviewed by 8 customers

        Sort by

        Displaying reviews 1-8

        Back to top

         
        4.0

        Hack 26. Create the Google Maps Scrollin

        By Strider

        from Sri Lanka

        About Me Developer

        Verified Reviewer

        Pros

          Cons

            Best Uses

              Comments about oreilly PHP Hacks:

              Hack 26. Create the Google Maps Scrolling Effect

              this code does not work for me.... can any one tell me correction

              images> img01_01.jpg , img01_02.jpg , img01_03.jpg
              img02_01.jpg , img02_02.jpg , img02_03.jpg
              img03_01.jpg , img03_02.jpg , img03_03.jpg

              [CODE]

              <?php
              $rows = 5;
              $cols = 5;

              $maxrows = 40;
              $maxcols = 40;
              $width = 200;
              $height = 200;
              ?>

              var origimgs = [];
              <?php
              for( $col = 0; $col < $maxcols; $col++ ) {
              ?>
              origimgs[ ] = [];
              <?php
              for( $row = 0; $row < $maxrows; $row++ ) {
              $id = sprintf( "img%02d_%02d", $row, $col );
              ?>
              origimgs[ ][ ] = ".jpg";
              <?php
              } }
              ?>

              var imgs = [];

              function startup()
              {
              <?php
              for( $col =+9 0; $col < $cols + 2; $col++ ) {
              ?>
              imgs[] = [];
              <?php
              for( $row = 0; $row < $rows + 2; $row++ ) {
              $id = sprintf( "img%02d_%02d", $row, $col );
              ?>
              imgs[][] = document.getElementById( "" );
              <?php
              } }
              ?>
              position(0,0);
              }

              var scrollrows = ;
              var scrollcols = ;
              var width = ;
              var height = ;
              var maxrows = ;
              var maxcols = ;
              var xpos = 0;
              var ypos = 0;

              document.onmousemove = function(e)
              {
              if ( dragging )
              {

              xpos += e.pageX - dragx;
              ypos += e.pageY - dragy;

              if ( xpos < 0 )
              xpos = 0;
              if ( ypos < 0 )
              ypos = 0;

              position( xpos, ypos );

              dragx = e.pageX;
              dragy = e.pageY;
              }
              }

              document.onmousedown = function(e)
              {
              dragging = true;
              dragx = e.pageX;
              dragy = e.pageY;
              }

              document.onmouseup = function(e)
              {
              dragging = false;
              }

              function position( x, y )
              {
              if ( x < 0 ) x = 0;
              if ( y < 0 ) y = 0;

              startcol = Math.floor( x / width );
              startrow = Math.floor( y / height );

              offsetx = Math.abs( x - ( startcol * width ) ) * -1;
              offsety = Math.abs( y - ( startrow * height ) ) * -1;

              viewheight = ( scrollrows + 1 ) * height;
              viewwidth = ( scrollcols + 1 ) * width;

              for( var row = 0; row < scrollrows + 2; row++)
              {
              for( var col = 0; col < scrollcols + 2; col++)
              {

              var left = offsetx + ( col * width );
              var top = offsety + ( row * height );
              imgs[row][col].style.left = left;
              imgs[row][col].style.top = top;
              imgs[row][col].src = origimgs[startrow+row][startcol+col];

              remainderx = viewwidth - ( left + width );
              remaindery = viewheight - ( top + height );

              if ( remainderx > width )
              remainderx = width;
              if ( remainderx < 0 )
              remainderx = 0;
              if ( remaindery > height )
              remaindery = height;
              if ( remaindery < 0 )
              remaindery = 0;

              imgs[row][col].style.clip = "rect( 0px 0px "+remaindery+ "px "+ remainderx+ "px )";
              }
              }
              }

              var dragging = false;
              var dragx = 0;
              var dragy = 0;

              <?php
              for( $row = 0; $row < $rows + 2; $row++ ) {
              for( $col = 0; $col < $cols + 2; $col++ ) {
              $id = sprintf( "img%02d_%02d", $row, $col );
              ?>
              " />
              <?php
              } }
              ?>

              [/CODE]

              (6 of 9 customers found this review helpful)

               
              1.0

              There is no example for smsclient. hack

              By mamay

              from Ukrane

              About Me Developer

              Pros

              • Some ideas are valuable

              Cons

              • Difficult to understand
              • Too many errors

              Best Uses

              • Intermediate
              • Novice

              Comments about oreilly PHP Hacks:

              1.there's no text file for sms hack in the examples they offer on the site.
              2.the code is almost unexplained by the authors and full of mistakes.
              3. some hacks are useless, for example, obscurejs, only laughing is caused by that hack.
              4.I would say Chinese quality this book has.
              5.the only value are some ideas but not the code.
              I wouldn"t publish this book in such a bad quality state.

              it seems that the authors are very avaricious of their ideas and because of low finance benefit they could receive from it they write it in such a low quality.

              Sorry for my English.

              (1 of 2 customers found this review helpful)

               
              4.0

              The book is really good...

              By Mamay

              from Ukraine

              About Me Designer, Developer

              Pros

              • Accurate
              • Concise
              • Helpful examples

              Cons

              • Difficult to understand
              • Too many errors

              Best Uses

              • Intermediate

              Comments about oreilly PHP Hacks:

              The book is really good, but there are some buts...there are some errors in the scripts, and it's very very difficult to find them for a begginer. I have download scripts, may be there the mistakes are absent.

              (1 of 3 customers found this review helpful)

               
              4.0

              Big bug in cal2.php script

              By Anonymous

              from Undisclosed

              Comments about oreilly PHP Hacks:

              I really loved this book as I am a php beginner. I'm also glad because I could debug a file :

              If you get the scripts at http://examples.oreilly.com/phphks/

              Look for cal2.php in cal directory, it was a review made by Alexander Naumann.

              The calendar script works well except in one case :

              when the first day of month is a sunday !

              To debug, find :

              # numeric weekday of the first day in

              # the current monthz

              $day = jddayofweek( $jd ) - 1;

              and just add : if ($day<0){$day=6;}

              Finally your file will look this way :

              # numeric weekday of the first day in

              # the current monthz

              $day = jddayofweek( $jd ) - 1; if ($day<0){$day=6;}

              Enjoy this great calendar !

              (0 of 1 customers found this review helpful)

               
              5.0

              Great book

              By Anonymous

              from Undisclosed

              Comments about oreilly PHP Hacks:

              I really enjoyed this book, it gave great, useful examples that every PHP-based website can use.

              But my favorite part was that he devoted an entire chapter to Design Patterns and how they are applied to PHP programming.

              As an experienced programmer, but novice PHP user I really liked the approach and it got me up and running fast.

              (0 of 1 customers found this review helpful)

               
              5.0

              Very nice!

              By acachinero

              from Undisclosed

              Comments about oreilly PHP Hacks:

              As a fan of the Hacks series, and as a fairly unexperienced PHP user, this book picked me up from the beginnings of PHP and dropped me off at the cutting edge, giving me the knowledge I yearned with a fun book through entertaining and often useful examples.

              (0 of 1 customers found this review helpful)

               
              5.0

              Stimulating -

              By Jetburg

              from Undisclosed

              Comments about oreilly PHP Hacks:

              I have found much that is useful - it has opened my eyes to new possibilities.

              Sadly, the source code for Hack #88 is not included in the handy archive.I recreated it from a file on the Oreilly German site, and compared it to the code in the book. There appears to be a problem with the function parseXML () - it dies and displays the error "could not open XML input"

              (1 of 2 customers found this review helpful)

               
              5.0

              Best PHP reference I have used, bar none.

              By Abe Usher

              from Undisclosed

              Comments about oreilly PHP Hacks:

              Excellent PHP resource



              I've read at least a dozen books on web development with PHP. This book is the best, by far!



              The good:



              Excellent coverage of elegant PHP for dealing with databases and XML

              Outstanding explanation of automated code generation (a must for professional PHP developers)

              Description (and code implementation) of how to use design patterns with PHP. Former J2EE guys will love this.

              High quality prose and clear descriptions. I did not find any grammatical or spelling errors.

              Light sense of humor (without the unnecessary banter that one finds in most "... for Dummies" books)



              The bad:



              Nothing.





              As a software developer of 10 years, I give this book my highest recommendation.

              Displaying reviews 1-8

              Back to top

               
              Buy 2 Get 1 Free Free Shipping Guarantee
              Buying Options
              Save a Tree - Go Digital  what is this?
              Ebook: $23.99
              Formats: APK, DAISY, ePub, Mobi, PDF
              Print & Ebook: $32.95
              Print: $29.95