Subscribe For Free Updates!

We'll not spam mate! We promise.

Aug 25, 2013

Email validation using JavaScript and Jquery

Email validation using JavaScript and Jquery :  Here i will explain how to validate email id with JQuery. In JavaScript we can check the email id format only. but in jquery we can check whether we allow or not some of domain names also. First i will explain basic javascript method to validate email id. Here is Javascript method : function...

Aug 19, 2013

PHP - Validate Email Id

PHP - Validate Email Id :  Here i will explain how to validate email id in php. This is very use full to validate email id in server side. php is used in server so we can validate email id in server side. if you want to validate email id in client side then you can use JavaScript, jquery etc...  The below example will show you how...

Aug 14, 2013

Create directory with current year and month name - php

Create directory with current year and month name - php :     Here i will explain about how to create folder / directory with the current year and month name. It is very usefull to seperate the uploaded image or file with the particular year and month name. Here we will use the simple concept to create this. here date() function...

Aug 13, 2013

Export particular column data from table in phpmyadmin

Export particular column data from table in phpmyadmin :  Here i will explain how to export particular column data from table. we can store the output in .sql or .csv file. In this method the output data will store in a file with newline (\n) separaters. The syntax is : SELECT column_name FROM table_name INTO OUTFILE '/opt/lampp/htdocs/fileName.sql' The...

Jul 31, 2013

PHP - To Check Query Process

PHP - To Check Query Process:  Here i will explain how to check the mysql query processing by using php. This function shows you which threads are running. Here i'm using "SHOW FULL PROCESSLIST" mysql command. This command is very useful if you get the "too many connections" error message and want to find out what is going on. The output...

Jul 30, 2013

PHP to get yesterday(previous) date

PHP to get yesterday(previous) date: Here are some methods to get the previous date using php. i.e.,) yesterday date. Here date() function is used and "D d-M-Y" format is used, it will return the date format like "MON 29-Jul-2013". Let we go to some examples to get the yesterday date in php. 1. echo date("D d-M-Y", time() - 60 * 60 * 24); 2....

Jul 14, 2013

Increase Import Maximum file size in phpmyadmin

Increase Import Maximum file size in phpmyadmin                    Here are the steps to increase the import file size in phpmyadmin. Usually phpmyadmin allows to import sql files maximum of 2M (i.e 2,048kb). To increase the maximum file size do the...

Replace MS Word single quotes in PHP

Replace MS Word single quotes in PHP:  The following function is used to replace Microsoft-encoded quotes in PHP. function replaeQuotes($str)  {      $str1 = array(chr(145),chr(146), chr(147), chr(148), chr(151));      $str2 = array("'", "'",'"','"','-');      return str_replace($str1, $str2,...

Remove MS Word special character symbol in html

Remove MS Word special character symbol in html :  To remove the MS Word special character in html page or website page you just add the bellow header meta tag in your header field. <META http-equiv="Content-type" content="text/html; charset=iso-8859-1"> Note: In some case the above meta tag will work individually, ie.,) No need to add...

Jul 11, 2013

PHP Remove HTML tags from a String

PHP Remove HTML tags from a String :  The following code is used to remove the html tags from string. <?php $input="Hi this is <b>TechniqZone</b>"; $text = strip_tags($input, ""); echo $text; ?> Output is Hi this is TechniqZone. The above code remove all html tags from string. Here strip_tags() function is used to...

Display Current Indian Standard Time using PHP

Display Current Indian Standard Time using PHP :  The following code is used to get the current indian standard time using php. here the default_timezone_set() function is used to set the country to set the particular time or date of that country. <?php date_default_timezone_set('Asia/Calcutta'); echo date("h:i a"); ?> Output of...

Jul 10, 2013

Php to convert UTC time to local time

Php to convert UTC time to local time  Here is a simple code to convert UTC time to local time in php. The $dateInLocal displays the UTC time as localtime. $time = strtotime($dateInUTC.' UTC'); $dateInLocal = date("Y-m-d H:i:s", $time); echo $dateInLocal;...

Jul 9, 2013

Attachment in mail using PHP

Attachment in mail using PHP In the previous post, I described HTML content in mails. In this post we can see how attachment in mails can be done using PHP . $to = 'youraddress@example.com'; //define the subject of the email $subject = 'Test email with attachment'; //create a boundary string. It must be unique //so we use the MD5 algorithm...

Jul 8, 2013

PHP to Determine Page Execution Time

PHP to Determine Page Execution Time : The below code is used to find the php page execution time. Just paste the below code in header portion in php page. <?php     $time = microtime();     $time = explode(" ",$time);     $time = $time[1] + $time[0];     $starttime = $time;  ;?>  after...

Jul 7, 2013

Sending Nice HTML Email with PHP

Sending Nice HTML Email with PHP :    Everyone wishes to include Html content in their mails. Here is a sample code to send a mail with HTML content. You can edit the HTML content as you prefer. $to = 'sample@example.com'; $subject = 'Sample HTML content'; $headers = "From: " . strip_tags($_POST['req-email']) . "\r\n"; $headers...

PHP Get Last 12 Months

PHP to get last 12 months :   The following coding is used to get previous 12 months by using PHP. <?php for ($t = 1; $t <= 12; $t++) {     echo date("F Y m", strtotime( date( 'Y-m-01' )." -$t months"));     echo "<br />"; } ?>  Output of this code is : June 2013 06May 2013 05April 2013...

Jun 17, 2013

Get all images from folder - php

Get all images from folder - php:  The below code is used to get all images from folder in local system. we can set the condition for file type to read files from particular directory in php. <?php $imgdir = 'images/';  $allowed_types = array('png','jpg','jpeg','gif');  $dimg = opendir($imgdir); while($imgfile = readdir($dimg)) {  ...

Jun 16, 2013

Javascript popup window to return value to parent window

Javascript popup window to return value to parent window:  We can pass the values to child window to parent window by using javascript. These passing methodology working with html tags and javascript functions. The javascript popup window is used to get the external value like select the region from map etc. Follow the below html programs to...

May 26, 2013

Rounding Numbers to ‘N’ Decimal

Rounding Numbers to ‘N’ Decimal  This will let you round off a number to ‘N’ decimal places. In the below example we are rounding of a number to 2 decimal places. var num = 4.56789; alert(num.toFixed(2)); It will alert as 4.56. Another function to display a number upto a length is toPrecision(x). num = 520.2375; result = num.toPrecision(4); alert(result); It...

Generate Random number from 1 to N

Generate Random number from 1 to N Below little script helps you in generating random number between 1 to N. var random = Math.floor(Math.random() * N + 1); ...

May 23, 2013

Basic MySQL Query Commands

Basic MySQL Query Commands : Syntax for Query Commands 1. CREATE Command The Create command is used to create a table by specifying the tablename, fieldnames and constraints as shown below: Syntax: $createSQL=("CREATE TABLE tblName"); Example: $createSQL=("CREATE TABLE tblstudent(fldstudid int(10) NOTNULL AUTO_INCREMENT PRIMARY KEY,fldstudName...

May 21, 2013

Get body message content from mail using PHP

Get body message content from mail using PHP :  Here i will explain how to get mail contents(body of mail) by using php. Here i used two functions like imap_num_msg() and imap_body() which return the contents of a specific message respectively and the number of messages in the mail box. Syntax of these function: int imap_num_msg ( resource...

May 19, 2013

.htaccess Automatically redirect to Mobile Website

.htaccess Automatically redirect to Mobile WebSite :  Here i will explain how to redirect your website automatically to mobile scree website. This method is functioned from your website .htaccess. so this method is more efficient compare with find screen resolution and then redirect. The .htaccess only assign our websites url functionality in on-load of...

Use JSON in PHP 4 or PHP 5.1.x

Use JSON in PHP 4 or PHP 5.1.x :  Here i will explain how to use JSON (json_encode() , json_decode()) in versions of PHP earlier than 5.2. Add the following custom function to use (json_encode() , json_decode()) this functions in php. IF u don't have this JSON PEAR Package You can download in HERE 1. for json_encode() : if (!function_exists('json_encode'))...

May 10, 2013

php to remove last two characters from string

php remove last two characters from string  The following code is used to remove character from the last of the string. here "substr()" function is used. this function is used to get substring from original string. <?php echo substr('abcdef', 1);     // bcdef echo substr('abcdef', 1, 3);  // bcd echo substr('abcdef',...

May 9, 2013

Check String Contain Specific words - PHP

Check String Contain Specific words - PHP The following code is used to find the specific words or char from a string by using php. here "strpos()" is used. This function is used to get string position from the original string. here i just get true or false result if the original string contains the specific word or character, if (strpos($a,'are')...

May 7, 2013

Get URL from address bar - PHP

Get URL from address bar - PHP  The following code is used to get full url address by using php. <?php $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo $url; ?> Notes:  Here we are using 2 functions in php to get full url from address bar. 1. $_SERVER['HTTP_HOST'] 2. $_SERVER['REQUEST_URI'] $_SERVER['HTTP_HOST']...

May 6, 2013

Random Password Generator

Random Password Generator  This tool is used to generate the random password that is generate random string with given "n" length. This tool is very use full for generate password with full secured. function f() { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; var n=document.getElementById("n").value; ...

May 5, 2013

Get details about an image in PHP

Get details about of an image in PHP: The following code is used to get the all details about image by using php and the result will be store in an array. <?php $filename = image.jpg; //image file path $imgDetails = getimagesize($filename); print_r($imgDetails); ?> The beloow code is simple to get width and height, type of the image...

May 4, 2013

Get cursor position in a textarea - Jquery

Get cursor position in a textarea - Jquery: The following code is used to get the cursor point in textarea. if you change the id of textarea with particular div id then you can get the cursor points within the div. (function ($, undefined) {     $.fn.getCursorPosition = function() {         var el = $(this).get(0);  ...

May 3, 2013

JQuery to get Current Date

JQuery to get Current Date:  The following code is used to get current date and time by using jquery.  Before that, Date() function is not the part of JQuery. it is one of JavaScript's features. var date = new Date(); var month = date.getMonth()+1; var day = date.getDate(); var output = date.getFullYear() + '-' + (month<10...

May 2, 2013

Random String Generator in PHP

Random String Generator in PHP:  The following function "getrandum_str()" is used to get the random string with specified string length. This function may used to get encrypted key value or generate the random password and etc... <?php function getrandum_str() {   $abc = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";  ...