Posts in the "Techniques" Category

  • If you want to plot Geographical data on a map and want to do it without integrating with third-party API’s like Google Maps, here’s an article which shows you how. The article shows you how to plot points on a map using PHP and GD. The code contains a function to convert latitude and longitude [...]

    Read More...
  • Yahoo’s UI Blog and Design pattern Library have interesting topics on patterns to follow while designing UI’s for Web 2.0 applications. In the old web, an action almost always followed a page reload or an intrusive Javascript pop-up, indicating that the action was complete. In the age of Ajax, how do we communicate the action [...]

    Read More...
  • Over at PHPIt, Dennis explains how to go around the globals problem in PHP by using Singleton and Registry patterns. In this article you will be shown how to properly use globals in PHP. We will take a look at the global keyword, function arguments, Singletons and the Registry pattern. PHPit – Totally PHP » [...]

    Read More...
  • Here’s an interesting read on error handling. “Very little software really gets error handling right. Even many critical, backend server systems tend to break under heavy loads. And the vast majority of end-user applications handle errors gracefully only for the most well understood, commonly encountered conditions (e.g. HTTP timeout), but very poorly for most other [...]

    Read More...
  • Here’s a piece of code which will force download a pdf instead of showing it inline in the browser. < ?php header('Pragma: public'); header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: pre-check=0, post-check=0, max-age=0'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/pdf; name="$path->pdfname”‘); header(‘Content-Disposition: inline; filename=”$path->pdfname”‘); readfile($path->pdfpath); ?> This code can be modifed [...]

    Read More...
  • Did you ever want to create your own HTML tags and have them displayed in a certain way, or make that tag perform some action? Here’s a tutorial which shows you how to do that by creating HTML widgets in PHP. In this tutorial you’ll learn how to create your own HTML widgets, using nothing [...]

    Read More...
  • Here’s an article that’s about a year old but getting some attention on reddit: Dave Astels’ blog entry titled A New Look at Test-Driven Development. He argues that the way most people view unit testing leads them to “divide tests in a way that reflects the structural arrangement of the code”, and I think he’s [...]

    Read More...