<?php
echo getipaddress();
function getipaddress(){
$xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=".getRealIpAddr());
print_r($xml);
$ccode=$xml->geoplugin_countryCode;
return $ccode;
}
function getRealIpAddr(){
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip=$_SERVER['REMOTE_ADDR'];
}
//$ip="YOUR IP";
return $ip;
}
echo "<hr>";
$details = ip_details(getRealIpAddr());
print_r($details);
function ip_details($ip) {
$json = file_get_contents("http://ipinfo.io/{$ip}");
$details = json_decode($json);
return $details;
}
?>
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
Friday, 18 July 2014
How to get IP based country,state,currency and countrycode and Internet connection Provider and lattitude & longitude in PHP?
Wednesday, 16 July 2014
How to download your profile from facebook?
1. Login to your FB account in http://facebook.com
2. Goto your Account -> Settings
3. Click Download as Copy & you have get mail from fb registered account
4. Check you mail the subject is " Your Facebook download is ready" and click the link
Ex: https://www.facebook.com/dyi?x=**************
5. You have get you full profile & uploaded photos, videos & wall everything will be get
Tuesday, 15 July 2014
CSS Message bog show automatically & hide
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<style type="text/css">
.message{ width: 90%; margin-left:auto; margin-right:auto; position: relative; top: 5px; }
</style>
<?php if(isset($_SESSION["e_msg"]) && $_SESSION["e_msg"]!=""){ ?>
<div class="alert alert-danger alert-error message" style='display:none;'>
<a href="#" class="close" data-dismiss="alert">×</a>
<strong>Error!</strong> <?php echo $_SESSION["e_msg"]; ?>
</div>
<script type='text/javascript'>
$( document ).ready(function() { $(".alert-danger").fadeIn( "slow" ); });
setTimeout(function(){ $(".alert-danger").slideToggle( "slow" ); },3000);</script>
<?php
unset($_SESSION['e_msg']);
}
if(isset($_SESSION["i_msg"]) && $_SESSION["i_msg"]!=""){ ?>
<div class="alert alert-info message" style='display:none;'>
<a href="#" class="close" data-dismiss="alert">×</a>
<strong>Note!</strong> <?php echo $_SESSION["i_msg"]; ?>
</div>
<script type='text/javascript'>
$( document ).ready(function() { $(".alert-info").fadeIn( "slow" ); });
setTimeout(function(){ $(".alert-info").slideToggle( "slow" ); },3000);</script>
<?php
unset($_SESSION['i_msg']);
}
if(isset($_SESSION["w_msg"]) && $_SESSION["w_msg"]!=""){ ?>
<div class="alert alert-warning warning message " style='display:none;'>
<a href="#" class="close" data-dismiss="alert">×</a>
<strong>Warning!</strong> <?php echo $_SESSION["w_msg"]; ?>
</div>
<script type='text/javascript'>
$( document ).ready(function() { $(".alert-warning").fadeIn( "slow" ); });
setTimeout(function(){ $(".alert-warning").slideToggle( "slow" ); },3000);</script>
<?php
unset($_SESSION['w_msg']);
}
if(isset($_SESSION["s_msg"]) && $_SESSION["s_msg"]!=""){ ?>
<div class="alert alert-success message" style='display:none;'>
<a href="#" class="close" data-dismiss="alert">×</a>
<strong>Success!</strong> <?php echo $_SESSION["s_msg"]; ?>
</div>
<script type='text/javascript'>
$( document ).ready(function() { $(".alert-success").fadeIn( "slow" ); });
setTimeout(function(){ $(".alert-success").slideToggle( "slow" ); },3000);</script>
<?php
unset($_SESSION['s_msg']);
}
?>
Friday, 11 July 2014
How to calculate no of working days in php?
function getWorkingDays($startDate, $endDate){
$begin=strtotime($startDate);
$end=strtotime($endDate);
if($begin>$end){
echo "tartdate is in the future!
";
return 0;
}else{
$no_days=0;
$weekends=0;
while($begin<=$end){
$no_days++; // no of days in the given interval
$what_day=date("N",$begin);
if($what_day>6) { // 6 and 7 are weekend days
$weekends++;
};
$begin+=86400; // +1 day
};
$working_days=$no_days-$weekends;
return $working_days;
}
}
How to find last day of month in jquery datetime picker?
function getLastDayOfYearAndMonth(year, month){
return(new Date((new Date(year, month + 1, 1)) - 1)).getDate();
}
Thursday, 10 July 2014
How to find your mobile number?
உங்கள் மொபைல் எண் மறந்துவிட்டதா? *********************************** "உங்கள் மொபைல் எண் திரையில் தோன்ற அழுத்துங்கள்" Idea சேவையைப் பயன்படுத்துபவர்கள் *1# Bsnl சேவையைப் பயன்படுத்துபவர்கள் *888# Aircel சேவையைப் பயன்படுத்துபவர்கள் *131# Videocon சேவையைப் பயன்படுத்துபவர்கள் *1# Airtel சேவையைப் பயன்படுத்துபவர்கள் *121*9# Reliance சேவையைப் பயன்படுத்துபவர்கள் *1# Virgin Mobile சேவையைப் பயன்படுத்துபவர்கள் *1# Vodafone சேவையைப் பயன்படுத்துபவர்கள் *131*0# Tata DoComo சேவையைப் பயன்படுத்துபவர்கள் *580#
Subscribe to:
Comments (Atom)
Feet/Inches to Meters Converter & Lbs to Kgs Converter
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Feet/Inches ⇄...
-
<?php $to = "somebody@example.com, somebodyelse@example.com"; $subject = "HTML email"; $message = " <h...
-
document.onkeydown = myKeyDownHandler; function myKeyDownHandler(event){ alert(event.keyCode) }
-
Input array= array("test"=>array("s1"=>array(),"s2"=>array())) foreach(array_keys($free_tim) as ...

.jpg)