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

Scale and rotate with webkit transition on mouse hover

This will works only for modern browsers such as Chrome(1.0), Firefox (4.0), Internet Explorer(10), Opera(10.5), Safari (3.2); It will not work for non-webkit browsers, means no scale and rotate effect is seen.

The example for the scale and rotate is here:
HTML

<div id="container">
<div id="selector" class="chkani">
<img src="player_play.png" />
</div>
</div>

 

now the CSS codes:
Read More

Create sticky footer with jquery and css

When we design a website that time we are not sure about the page height means how much long or short our page. In most of the cases we are trying to fill the page with more and more content so that the footer of the page appear always on the bottom of the page. But in some case we don’t have enough content to represent to the visitors and in that case the footer looks weird that attached with the content.

sticky footer
Read More

Caching mysql result with memcache and php

There are many ways to boost up the performance of the website like css amalgamation with php, use of plugins, caching in your php scripts, optimize your images, database etc.

I am going to share one of the method i.e memcache which help us to optimize load on the database. Normally a request for a dynamic page triggers multiple db queries, processing of output, and finally formatting to display on browser. This process can eventually be slow on larger sites or slower servers.
Read More

Email Validation with php and jquery

Generally we are using an email address to know about unique visitors, because email id is unique address of a user and to validate that email id is must for us so that our user information prevent from spammers. Email validation is possible in any scripting language and in this post we will talk about email validation with php as well as jquery. In php we can use preg_match() function to check if the email format is correct or not. We will use the follow codes:

function checkEmail($str) {
    $regex = "/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i";
    $string = trim($str);

   return preg_match($regex, $str)) ? TRUE : FALSE;
}

 

In the above codes we made a function named checkEmail() now we will implement this function to check an email address.

Read More