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

Uploading huge files (i mean huge ones, like 5Gig and upwards). No PHP :P

Okay, here is an interesting find. Although I have never had a client who asked me to upload files larger than 10MB , i have always wondered if there was a better way to do it without using PHP. The … Continue reading

Posted in General | Tagged , , | 1 Comment

Morph Exchange to offer PHP

Morph Exchange brought by Mor.ph is “Software as a Service” company that provides applications spaces/platforms for Ruby on Rails and just recently Java. A few weeks back, I emailed them if they have support for PHP. And guess what, they … Continue reading

Posted in General | Tagged , , , , | 3 Comments

PHP: Ternary Operator

This is one my favorites. Sometimes I use this when I come around “short” conditions in variable assignments. Instead of writing something like this: if (isset($myvar)) { $temp = $myvar; } else { $temp = ""; //i need to set … Continue reading

Posted in General | Tagged , | 2 Comments

Twitter moving away from Ruby on Rails

This may be a rumor but Techcrunch is reporting that Twitter is abandoning Ruby on Rails due to scalability issues. I have read a few articles a while back about people having problems with Ruby on Rails. That is why … Continue reading

Posted in General | Tagged , , , | 3 Comments

Mixing PHP Variables with Javascript (Zend Framework and jQuery)

Sometimes, I “mix” PHP variables with Javascript. For example, I have something like this: function deletenote(notes_id) { if(!confirm("Delete note? You will not be able to undo this action.")) return false;   $.post("< ?=$this->baseUrl?>/notes/deletenote",{ skeedl_notes_id: notes_id }, function(data){ $(’#notes_id’+data).fadeOut(); }); } … Continue reading

Posted in General | Tagged , , , | 7 Comments

Serialize + base64_encode an array for a URL

This is an alternative for passing a bunch of variables in the URL. The variables might be used for pagination scripts (limits, etc.), sorting results and others. Generally, I would do something like this for sorting results: http://localhost/reports?sort=username&sort_type=ASC That will … Continue reading

Posted in General | Tagged , , , | 2 Comments

Reading and Writing Excel Spreadsheet Using PHP

I have blogged about Microsoft Excel and PHP within the past few months. So a post from Zend Devzone caught my attention. It is about reading and writing into Excel using PHP. You can add a spreadsheet, do calculations and … Continue reading

Posted in General | Tagged , | Leave a comment

What Zend_Layout looks like. An overview. Code sample. No explanation :P

I wrote this for myself instead of for other people. The short code example is found on my wiki (http://wiki.ekini.net/main/Zend_Layout). Basically it is a very quick overview of Zend_Layout — more like a cheatsheet (again). The bootstrap, the directory structure … Continue reading

Posted in General | Tagged , , | 3 Comments

Get number of hours between 2 timezones

Here is a way to get the number of hours between two different timezones. I am sure that there is a way of doing it shorter and faster, but I did it this way for readability purposes. date_default_timezone_set("America/Kentucky/Louisville"); $lex = … Continue reading

Posted in General | Tagged , | 7 Comments

How to filter database inserts – HTML, Usernames, etc. in Zend Framwork

I woke up today thinking about how to handle strings when inserting to MySQL. What if the string I am trying to save into the database contains HTML characters? Let’s say you are using FCKEditor, how would you “generally” handle … Continue reading

Posted in General | Tagged , , | 6 Comments