PinoyTech.org

CodeIgniter, Kohana, Mootools, jQuery and CSS

UserCake : Simple User Management System

Posted by teejay on December 3, 2009

UserCake logo

User Management is a commonly seen in most web applications today. That's why it's important for any web application to have a pretty secure scalable user management system.

Welcome, UserCake (not to be affiliated with the PHP Framework CakePHP). It acts as a baseline for you user management needs.

Continue reading UserCake : Simple User Management System

 

CodeIgniter Image Manipulation Class: How to Resize

Posted by teejay on December 1, 2009

CodeIgniter logo

The CodeIgniter Image Manipulation Class is a useful tool when implementing simple resize, cropping, rotate, watermarking and flipping of images are required in your project.

Here is a series of code templates for using the CodeIgniter Image Manipulation Class:

First one is resizing:

Continue reading CodeIgniter Image Manipulation Class: How to Resize

 

The Right Way to Get a File Extension in PHP

Posted by teejay on November 29, 2009

I made a recent search on retrieving file extensions in PHP.

I found out that a lot have been re-inventing the wheel. They have been creating code for functionality that PHP already has. This is one example of re-inventing the wheel

function get_file_extension($file_name) 
{
    return substr(strrchr($file_name,'.'),1);
}

Another example was this:

function file_extension($filename)
{
    return end(explode(".", $filename));
}

PHP already has a function that does the same thing and more.

Continue reading The Right Way to Get a File Extension in PHP

 

How to Disable Image Caching

Posted by teejay on November 28, 2009

Browser caching is useful. It lets you load pages faster by storing cache-able files on your computer. If you have a slower internet connection, this will most likely be helpful to you.

However, the problem arises if you a programmer that needs images to be fresh. I've recently creating a image manipulation program and needed to the images NOT to cache. Here's a trick to do this:

Continue reading How to Disable Image Caching

 

PHP Delete Function

Posted by teejay on November 28, 2009

There is actually no delete function in PHP. However, there is a PHP function that does the function of a delete if there was one.

Welcome unlink, the PHP delete function.

PHP Unlink function usage

unlink('/uploads/my_photo.gif');

Continue reading PHP Delete Function

 

CodeIgniter AJAX Helper

Posted by teejay on November 13, 2009

This is a quick post on how to recognize AJAX Requests.

<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

function is_ajax()
{
    return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
}

?> 

Continue reading CodeIgniter AJAX Helper

 

AJAX with CodeIgniter

Posted by teejay on November 13, 2009

AJAX can be seen almost everywhere on the web. Yahoo uses it. Google uses it. My boss uses it. My grandmother uses it — well maybe not but that shouldn't stop you from using it.

Here's an awesome tutorial to use AJAX with CodeIgniter.

Continue reading AJAX with CodeIgniter

 

CodeIgniter FAQ: Loading a View within a View

Posted by teejay on November 9, 2009

A lot of new CodeIgniter users have at one point asked, "How to load a view within another View?"

To load a view within another view. We can also use the same method we used in the controller to load the "primary" view.

Continue reading CodeIgniter FAQ: Loading a View within a View