Random password generator with php

In this post we are just creating a PHP function that provide us a random password string. This Password string is the combination of small and capital alphabets and digits, that help us to generate random password string. To generate the random password we are using here `mt_rand()` a PHP function. We can also use `rand()`, because both the functions provide the random strings but `mt_rand()` providing four time better random string then `rand()` function.

Read More

Get element on event with jquery

What If we apply an event on multiple element? Yes in this post we are talking about to get the element on particular event. Let’s say we have more then one element and on these elements we want the click event. But now how do we detect the clicked element. In the given example, i just talking two input fields, with different name and id. And apply the click event on both elements.

Here is the HTML Example:

Read More

Create tab using jquery and css

Creating tab is very simple with the use of CSS and JQuery. As We know that JQuery is the most popular JavaScript Library. In this Post you can find all the stuff that you need to creating tab. Well if we talking about why we using tab, because with the use of tab we can provide more data or introduce more stuff about the website and divide that stuff in separate tabs. Each Tab contain the relative data or HTML Stuff.

AS you see in the below HTML section, that i have used li markup, which contain the tabs, Tab 1 and Tab 2. And below div with i also set two div which contain the separate tab data. Now you have to play with the CSS that gives the look of tabs to this HTML section. And you will get the CSS, just below the HTML Section.

Read More

Base64 encoding format for images

Today we are taking about the new base64 encoding format for displaying the image or a collection of images. If you have the images with large size then it will take more time to load on the page, base64 encoding provide you the string which will contain all the image data, and load in minimum time on the page. Actually base64_encode() represent the binary data into into an ASCII string format. As you see google also uses the string format for the images to prevent from the server load. You will use this base64 encoded string in ‘img’ tag something like this:

Read More

Creating zip file archives in php

In this post we are talking about to creating zip file in PHP. It’s very simple to create zip file, similar to creating in desktop. There is one more logic behind to creating zip file, if you want give some stuff for download to your users, then you have to upload completely zip file in your server then provide the download link over it.

But with the use of this function you just have to give the files that you want to store in zip and the name of the zip file that you want to create, yes you will create a single zip file with the collection of files. As you see in the below codes i have created a simple form and with the use of check-box i have given the choice for the files that you want to add in the zip file, and then all the rest work depending on the PHP.

Read More

Get focused element in jquery

Mainly jQuery .focus() event is used to get focused element, but what if we have a chain of elements in a single .focus() event? In this post i simple describe that how do we get focused element with jquery in a chain of elements with the use of .focus() event. As you see below highlighted codes i show you both the jquery section and the html section, First i want to describe the html section, in the HTML section in also mentioned the ID of the the input element, all the ID’s are different according to the input element.

Read More