Monday, June 14, 2010

Cakephp - Adding meta data to a website

meta(string $type, string $url = null, array $attributes = array(), boolean $inline = true)

This method is handy for linking to external resources like RSS/Atom feeds and favicons. Like css(), you can specify whether or not you'd like this tag to appear inline or in the head tag using the fourth parameter.


$html->meta(
'favicon.ico',
'/favicon.ico',
array('type' => 'icon')
);?> //Output (line breaks added)




$html->meta(
'Comments',
'/comments/index.rss',
array('type' => 'rss'));
?>

//Output (line breaks added)

Wednesday, June 9, 2010

Jquery : Attaching an event to multiple elements at one go

var a = $("#a");
var b = $("#b");
var combined = a.add(b);

Now u can use

combined.click(function () { /* */ });


this can be used in situation where u want to add same validation to two different forms

Thursday, May 13, 2010

Create a Simple Image Slide Show using jQuery









   Simple Slide Show with jQuery

   

   





   



Php- File upload limit changing using htaccess/php.ini

FASTCGI  / APACHE - Changing PHP File upload limit 
Php default maximum upload limit is 8 MB. You can change the default settings by changing the server settings using .htaccess file or custom php5.ini file in the case of godaddy hosting.   
First thing you have to find out is what your server API is?
print out php info of your hosted server.



See the  Server API value.
If  the Server API is apache You can do the following


1) Create a .htaccess file in the root folder of web server.
2) Put the following code in side the .htaccess file and save it.
php_value upload_max_filesize 20M
php_value post_max_size 20M
php_value max_execution_time 200
php_value max_input_time 200

 This will work in godaddy hosting.

If your Server API is CGI/FASTCGI do the follwing . 

create a php5.ini file and write in it

upload_max_filesize = 100M
post_max_size = 100M
output_buffering = on
max_execution_time = 1000
max_input_time = 1000
memory_limit = 64M

And upload it to your websites root folder.
Check the phpinfo and you can see the changes if it worked.Do not forget to put the file name php5.ini.