A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Tag Archives: PHP

CakePHP 2.x: CSV File download from a database query

Here is a quick way to output/stream/download a CSV file from your database using CakePHP. For simplicity, I have placed everything in the controller. Not good practice but it quickly does the job. <?php class UsersController extends AppController {   … Continue reading

Posted in Uncategorized | Tagged , , | 3 Comments

Beginner’s Guide to OpenX Ad Server

I got an email from Packt Publishing to review a book that they will be releasing very soon (March 2010?). The book is about OpenX. In all honesty, I have not even tried to use OpenX Ad Server yet. Still, … Continue reading

Posted in General | Tagged , , , | Leave a comment

Zend Framework: Handling file uploads with Zend_File_Transfer

Here is a tutorial on how to handle file uploads with Zend_File_Transfer. Like so many of the other powerful components made available through the Zend Framework, the Zend_File_Transfer component is intended to make your life much easier when it comes … Continue reading

Posted in General | Tagged , , | 1 Comment

Newline character “n” problems in a Javascript string + PHP

I have just spent an hour an a half trying to figure out why the newline character “n” caused an error in my Javascript. I am posting this because I have been unsuccessful in finding a solution to this problem. … Continue reading

Posted in General | Tagged , , | 1 Comment

Zend Framework: Creating your own view helpers

This short tutorial assumes that you are using Zend_Framework 1.8, the latest stable release as of this post. To learn more about View Helpers, the Zend Framework Manual as an entire page for it found here. First, you need to … Continue reading

Posted in General | Tagged , , , , , , | 8 Comments

PHP: Using an object property with a dash

Earlier at home, I recently encountered this problem when I was using Zend_Service_Twitter to get the rateLimitStatus of API calls. One of the values returned by the successful API call contained a dash(-); I needed to do something like this … Continue reading

Posted in General | Tagged , , , , | 2 Comments

Note to Self: PHP shipped on Mac OSX is broken and old

I had to learn the hard way. On my Mac I have MAMP installed. MAMP great piece of software that installs Apache, MySQL and PHP. It makes everything easy. As of this post, the PHP included in MAMP is PHP … Continue reading

Posted in General | Tagged , , , , | 8 Comments

PHP: Using variables for calling object properties

I had a scenario at work today that need me to use a variable in an object and call it like I would when using keys in an array. Like when I have an array, I would do something like … Continue reading

Posted in General | Tagged , , , | 5 Comments

PHP: Get start and end dates of a week from date(‘W’)

First off, from the PHP.net Manual, the ‘W’ inside the date() function returns the week number for a year. Week ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the … Continue reading

Posted in General | Tagged , , , , | 4 Comments

Arrogance is Limiting Framework Adoption by Cal Evans

I rarely post articles like these. But this one will hit a spot on some developers. I personally think that arrogance is a dangerous trait for a programmer/developer. I would not want to work with someone who thinks so highly … Continue reading

Posted in General | Tagged , , | 1 Comment