Category: Scripts

How to validate email id in javascript 0

How to validate email id in javascript

Find the below code by which you can validate the email field using java-script on client side, var reg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; if(!reg.test(document.getElementById(“email”).value)){ alert(“Please fill email address in correct format”); document.getElementById(’email’).focus(); return false; }

How to export Email List from cpanel using javascript and firebug 0

How to export Email List from cpanel using javascript and firebug

To export the email address with the help of java-script: Login your cpanel and select the Email Accounts under the Mail section and change the result per page to show all the emails. Now...

Get customize categories in wordpress 0

Get customize categories in wordpress

The following example will show the categories with checkbox <?php $args=array( ‘child_of’ => ‘1’, ‘hide_empty’ => ‘0’ ); $categories = get_categories($args); foreach($categories as $key => $value){ ?> <label><input name=”escorts_category[]” value=”<?php echo $categories[$key]->cat_ID; ?>” type=”checkbox”>...

Calculate average and sum from Mysql query 0

Calculate average and sum from Mysql query

The AVG function return the average value of the specified column. For example I have a table of product list and now I want the total of price and average price of all the...

How to get number of days between two dates in PHP 0

How to get number of days between two dates in PHP

By the given blow script we can find the number of days between two dates <?php $first_date = strtotime(“2010-08-01”); // or current date as well $second_date = strtotime(“1988-08-01”); $datediff = $first_date – $second_date; echo...

Show Top Comments or Commentators In WordPress Without A Plugin 0

Show Top Comments or Commentators In WordPress Without A Plugin

Here is a simple code snippet to show the top commentators or comments in the wordpres without any plugin. The code are given blow. function top_comment_authors($amount = 5){ global $wpdb; $results = $wpdb->get_results(‘ SELECT...