Image upload and resize with php

There is a lot of things that we want to do with in less time and working properly. Lets take an example to resize an image, for doing this first of all we need an image edit software and then open that image and resize and at the last save. That will take a lot of time, I am not talking here about image editing software or how to edit an image. I am talking about how to resize an image with php. Obvisioly if you want to edit an image then Adobe Family’s products are far batter whose provide you a lot of functionality.

Now lets come to the point, Before starting let i tell you a bit about this image resizing class. First of all we need to verify an image means get the file extension and check whether it is an image or not. I allow only .jpeg, .jpg, .gif, .png files. After that we have to check the image size, then set the image width and height according to real image, so that the quality of an image remain same, means not stretch when we resize it. Then simply genrate a new image that’s it.

Read More

Read RSS Feeds with SimpleXML

RSS(Really Simple Syndication) is used to distribute updated web content of the website to all over the world. It is generally used by those who updated his work over the web such as blog entries, news bulletins, audios or videos. RSS basically a Standardized XML format which allow publishing the data on the web and easily reading by any programming language Like Java, .NET, PHP etc. RSS provide benefit to there user who want to get the favorite latest information from subscribed website.

Here is an example to read RSS feeds with SimpleXML. SimpleXML is a extension of PHP that allow users to read or manipulate xml data. If you want to use this extension then you have to use PHP5 or grater then.
Read More

Ajax based instant image upload

Image upload is simple to just select an image and click on the upload button that’s it. But it will be more effective when the selected image upload instanly means with out click on any upload button and you will see also the preview of that uploaded image.

All this will be more easy with ajax (asynchronous javaScript and xml) request. In this example we will use the ajax form plugin. I really thanks for this plugin because with the help of this plugin it will be more easy to make an ajax based instant image upload script.

Instant Image Upload

Read More

Get file extension with php

When we give permission to users to upload a file, then it is must to validate that file. And that validation is to get the extension of the file and check if the file extension is match with the related extesions or not. Here is a small function to get the file extesion with php.

Read More

Dynamic select box with php and jquery

Most of the websites and web-applications are developing in server scripting languages. And the GUI part are designed in jquery, css and html. For GUI designing purpose jquery is easy and light so that the website will open quickly.

We use jquery because it is the cross browser compatible, so that the GUI remain same in the modern browsers. Jquery also using to send back-end or to gathering the data from cross domain. In this example we use jquery for dynamic dependent select boxes so that the page will not refresh every time when the related data are loading.

Read More