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 run code of php5 on a server with php4 using htaccess

This is big question for beginners every time.Now as we know that php5 is in full flow but still there are lot of servers out there with php4 and if you upload your php5 code on those servers then it will be mess.May be your site will not run or any part or your will go down.But don’t worry friends , there are only 2 lines to put this problem far from you.
Just put these 2 lines below in a htaccess file and put that htaccess at the root directory.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

Now all the modules either they have written in php4 or php5 will work very well.

.htaccess file at godaddy

Godaddy a big name in the world of internet and web hosting. There are thousand of websites hosted on godaddy.com. Lot of programmers have faced godaddy, may be they are experienced or fresher. In today’s programming world htaccess is a comman name but its always an advanced topic specially for beginners. As search engine markting is growing everyday , the use of htaccess is also growing . But there is difference between godaddy’s htaccess and other htaccess , not very much but that is important to know for everybody.If you are not familiar with the rules of godaddy’s htaccess then it will make headache for you.

Read the rest of this entry »

How to speed up my site

Each and every single web site owner wants to see his/her website pages load faster than others but only some of them got it because its depend on server , network speed and mostly on programmer’s work strategy.An intelligent programmer always try to make site faster.Becasue when user surf a web site they want to run that faster and if site run slow than they switch to other site.The load time of websites is one of the most important factors affecting its usability; most Internet users will just skip a site altogether if it fails to load within a couple of seconds.

1. Optimize Images: always use Optimized images on a web page. Images represent the heavier load on virtually any website so make sure you are optimizing them. Alternatively you can also turn to an online image optimizer.When save image in an image editor try to save them with low resolution and save them using shift+ alt + ctrl +s for a web page.Even try to minimize image on a web page and make effect using css that will load the page faster.

Read the rest of this entry »

What is PHP ?

PHP (Pre Processor Hyper text ) is a scripting language that was originally designed for web development. PHP can be easily embedded in HTML. PHP generally runs on a web server. It is available for free and can be used across a variety of servers, operating systems and platforms. When a visitor opens a php page, the server processes the PHP commands and then sends the results to the visitor’s browser.

PHP only parses code within its delimiters (<?php and ?>). Anything outside its delimiters is sent directly to the output and is not processed by PHP.
<?php means starting of php code
?> means end of php code
You can also use the syntax below
<script language=”php”>
echo “Test”;
</script>

php’s short tags are  <? and ?> but short tag can be disabled in the PHP configuration so always use <?php and ?>