How to Disable Image Caching
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
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
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
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
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
PHP's Ternary Operator
This is probably something old for most PHP developers out there. Unfortunately, I see tons of questions about what the ternary operator.
Continue reading PHP's Ternary Operator
How to do Multiple SQL Inserts
Using multiple insert queries almost always slip my mind when developing applications. If you are like me, we all need some reminder in some way or another.
Continue reading How to do Multiple SQL Inserts
How To Set-Up CodeIgniter
The CodeIgniter framework is one of the easiest frameworks to set-up whether it is on a development server or production server.
Continue reading How To Set-Up CodeIgniter