Sunday, 25 October 2015

Get visitor’s location details from IP address using php


/*Get user ip address*/

/*Get user ip address details with*/
$addrDetailsArr = unserialize(file_get_contents($geopluginURL));

/*Get City name by return array*/
$city = $addrDetailsArr['geoplugin_city'];

/*Get Country name by return array*/
$country = $addrDetailsArr['geoplugin_countryName'];

/*Comment out these line to see all the posible details*/
/*echo '<pre>';

   $city='Not Define';
   $country='Not Define';
echo '<strong>IP Address</strong>:- '.$ip_address.'<br/>';
echo '<strong>City</strong>:- '.$city.'<br/>';
echo '<strong>Country</strong>:- '.$country.'<br/>';


Friday, 23 October 2015

while loop checkbox validation using javascript

function validate(){
if($('input[name="check_list[]"]:checked').length == 0) {
    alert('No checkbox is checked');
    return false;
  return true;

<form action="" method="post"  onsubmit="return validate();"  enctype="multipart/form-data">

  <input type="checkbox" name="check_list[]" value="">
 <input type="checkbox" name="check_list[]" value="">
  <input type="checkbox" name="check_list[]" value=""> 
 <input type="checkbox" name="check_list[]" value=""> 

<button  class="btn  btn-danger" type="submit" name="upload"> Send </button>