Archive for the ‘
Tricks ’ Category

.htaccess file is a magic file. You can change the way your website works by using it. I have been reading a lot about .htaccess files. Perticularly .htaccess is very useful in shared web hosting environment where the users have no direct access to their servers or they want to implement some restrictions/security to their files. I will include here some very essential and useful .htaccess tricks. I have used some of these tricks and more to secure my websites according to my web server’s environment and to optimize speed/performance of my websites. Websites with heavy traffic, Digg traffic, Stumble upon or slashdot traffic will need to be optimized via many ways and .htaccess can help a lot.
(more…)
If you have to create a date object of future or past, you can do it by using the second parameter of PHP date function. This is extremely useful when doing BETWEEN comparison in MySQL. You can build the date and bind it to query.
(more…)
With this PHP script you can find size and type (extension) of required file.
(more…)
By default there is a restriction of 2 Megabytes file upload at a time for PHP. If we have to upload media files or other large files then we will have to change some settings in php.ini.
- Locate the php.ini file in the folder your upload script resides in. If none exists, install a new php.ini file from the PHP config icon in cPanel. Then, use the File Manager to rename php.ini.default to php.ini
- In the php.ini file, locate the line called ‘upload_max_filesize = 2M’
- Modify that entry to read ‘upload_max_filesize = 10M’, or whatever your script requires. (M = megabytes)
(more…)
I think there is no way yet to find out screen resolution with PHP. hehehe.
If I am wrong please correct me.
But yet we can trick it to be happen ;-)
If not then how can we be developers. Right!
With javascript we find out screen resolution of PC. Store it in a cookie and display it with PHP.
Coool…eh! Fine, lets just do it.
(more…)