PHP Magic Book – Free PHP Scripts, Tutorials and Downloads, PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips

Archive for the ‘ Tricks ’ Category

.htaccess Essential Tricks For Blog/Website Performance – Guide

htaccess-tricks

.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…)

Tags: , , , ,
Posted in: Tricks, Useful Scripts, htaccess
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Date Object For Future or Past – Easy Monthwise or Datewise Records Selection Using PHP

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…)

Tags: , , ,
Posted in: Date & Time, Select, Tricks, Useful Scripts, php mySQL
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Get File Size and File Type In PHP

With this PHP script you can find size and type (extension) of required file.

(more…)

Tags: , ,
Posted in: File, File Manipulation, Info, Tricks
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Upload Max Filesize – Large File Uploads in PHP

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…)

Tags: , ,
Posted in: File Upload, Tricks
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Find Screen Resolution With PHP

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…)

Tags: , , ,
Posted in: Checks, Cookies, Tricks, Useful Scripts
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment



  Subscribe Via RSS
  Subscribe Via Email