How to unzip a zip file using php

Very exciteing and challenging work!.You are thinking that what is exciteing and challenging in this work but i am talking about how to unzip a zip file using php.
Some times programmer has the requirment to select a zip file and unzip all the files and folder at a particular location and then delete that zip file.

I faced this problem first time when i was making a file manager in php . That was not just a file manger but also a full featured ftp client.I tried to search on
google but not found anything .finally i got a small help from google and than i made a good function for you all to unzip a zip file.

Read the rest of this entry »

how to download a file without display download request

Usually when we try to download something from a server we get a confirmation request whether you want to save the file or open it.
To avoid this request you can use the below code and then user can directly download that file without any message.

First give a link or a button for user to download and when they click redirect them to a file which will have the code below.

suppose you want user to download a pdf file then first make a link like this:

<a href=”javascript:void();” onClick=”location.href=’doc/document_download.php’”>download pdf</a>

Read the rest of this entry »

Latest news in php – What is new in PHP 5.3

This release of PHP 5.3 is a major improvement in the 5.X series, which includes a large number of new features and bug fixes.

The key features of PHP 5.3.0 include:

* Support for namespaces
* Late static binding
* Lambda Functions and Closures
* Syntax additions: NOWDOC, ternary short cut “?:” and jump label (limited goto), __callStatic()
* Under the hood performance improvements
* Optional garbage collection for cyclic references
* Optional mysqlnd PHP native replacement for libmysql
* Improved Windows support including VC9 and experimental X64 binaries as well as portability to other supported    platforms

Read the rest of this entry »

How to use Cookies in PHP

In the starting Cookies were not in common use but this is very common to use Cookies now a days.

Cookies allow the us to store information about the site visitor on their computer to be accessed again the next time they visit. One common use of cookies is to store your username and password on your computer so you don’t need to login again each time you visit a website. Cookies can also store other things such as your name, last visit, shopping cart contents, etc.

Cookies are just like sessions.The main difference between a cookie and a session is that a cookie is stored on your computer, and a session is not. Although cookies have been around for many years but sessions can be stored only for a perticular user session and when user leave a site or close the browser sessions gets destroy. Cookies and sessions can be removed by the user at any time, so don’t use them to store anything too important.

Read the rest of this entry »

Best open source CMS in php

There are lot of articles on internet about this topic. But after reading those articles i felt that they are making confusion in reader’s mind because they are providing list of all the open source CMS and comparing them .After reading these articles a normal user can’t decide which CMS is best for him/her even they find them self in a hacting situation where they can’t decide best. There are near about 50 cms in php ,some of them are free and some of them are paid. They all cms has different length of functionality means some provides basic functionality and some provides complete control over site management (look and coding).

Read the rest of this entry »