From The Blog

Problem with Apache 2 on linux not reading .htaccess files

I had a problem with my apache2 configuration that it seems not reading .htaccess files at all, I tried many solutions but nothing worked until I...

Read more
Easy restart apache server

$ service apache2 restart

Read more
How to start/stop/restart Apache service

Task: Start Apache 2 Server # /etc/init.d/apache2 start or $ sudo /etc/init.d/apache2 start Task: Restart Apache 2 Server # /etc/init.d/apache2...

Read more
How to detect client browser?

/****** Browser Detection ******/ function testCSS(prop) { return prop in document.documentElement.style; } var isOpera = !!(window.opera &&...

Read more
Strip HTML tags and it's contents too

To strip tags we can use the php function strip_tags($str) but it will return the content of the tags too, How to strip html tags and remove it's...

Read more
How to get logs for SVN ?

To get svn log from current path: svn log -v -r {2008-09-23}:{2008-09-24} To get svn log file and save it to a file: svn log -v -r {2008-09-23}:{...

Read more
Get base url using javascript

function getBaseURL () {    return location.protocol + "//" + location.hostname +       (location.port && ":" + location.port) + "/"; }

Read more
Don't forget to enable cache check to enable caching

To use the cache helper in any view or controller, you must first uncomment and set Configure::Cache.check to true in core.php of your app/config...

Read more
How to disable browser cache in CakePHP

use the useful callback disableCache(), that will tell the user's browser not to cache the results of the current request. This is different than...

Read more
Get selected value text from dropdown with jquery

the fastest way to get selected value text from a dropdown is using: $('#dropdown_id').children("option:selected").text()

Read more
How to check a not defined variable in javascript

In JavaScript null is an object. There's another value for things that don't exist, undefined. The DOM returns null for almost all cases where it...

Read more
are these functions identical

Let's see this question: //Assume function example1(){ echo 'example 1'; } //,and function example2(){ echo 'example 2'; } //True or False...

Read more
Installing PHP5 and Apache on Ubuntu

First, you'll want to add the extra repositories to Ubuntu's sources.list file. From a command shell, you will run the following commands: sudo apt-...

Read more
Adding extra Repositories on Ubuntu

Repositories on Ubuntu are the locations that you can download software from. As a general rule, the default repositories don't contain the right...

Read more
install mysql server 5 on ubuntu

Open a terminal window, and use the following command: sudo apt-get install mysql-server If you are running PHP you will also need to install the php...

Read more
jQuery: Accessing iFrames

$("iframe").contents().find("#someDiv"); but this will give you the error "Unsafe JavaScript attempt to access frame"

Read more
Using Yahoo Weather API to get weather conditions in CakePHP2

// import XML class App::uses('Xml', 'Utility'); // your XML file's location /*w is the code of the city, and u is the unit of temperature (c/f) $...

Read more
Parsing XML easily in CakePHP 2

It is very easy to parse XML in CakePHP , here is an example in CakePHP v2 // import XML Utility class App::uses('Xml', 'Utility'); // your XML...

Read more
Simple crawling using cURL

example of simple crawling of web pages using client URL (cURL) $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "http://www.example-url.com");...

Read more
Shorten your URLs

public function tinyURL($url = null) { if ($url) { return file_get_contents("http://tinyurl.com/api-create.php?url=".$url); } else { return false...

Read more
How to delete entire directory which is not empty in PHP

In PHP to delete a file we use unlink() function, and to delete a directory we use rmdir() function but the directory has to be empty first Here is...

Read more
Drupal variable functions automatic serialization

Drupal's variable functions automatically serialize and unserialize variables so, variable_set automatically serialize variables, and variable_get...

Read more
CakePHP 2 aggressive Security - continued

CakePHP 2.0 has another aggressive security which is shown clearly when trying to make an ajax request to an action via method POST, it fires...

Read more