Thursday, 2 November 2017

How to check your server IP address

If you try to use API for domain registration and payment gateway integration then you need your server IP address. If don't know your right server IP . Just create a page on your server and paste this code then open page you will see your right server IP address.

***************************
 <html>

<body>

<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,'http://www.ipchicken.com/');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$contents = curl_exec ($ch);

curl_close ($ch);

echo "Your Server's IP : ".$contents;

?>

</body>

</html>
****************************

Friday, 7 July 2017

Redirect a web page to another web page

Here two method of redirection of web page

First method :

simple copy and paste this code :

<meta http-equiv="refresh" content="10; url=http://targeteddomainname.com/" /> 

in your web page. http://targeteddomainname.com change with your target web page url. where you want redirect to page. content="10" here 10 is 10 sec you can change time as per your need.

Second method : jave script

simple copy and paste this code :

<p>You will be redirected home page in <span id="counter">10</span> second(s). If You not redirected <a href="http://targetdomainname.com">Click here for home page</a></a></p>
<script type="text/javascript">
function countdown() {
    var i = document.getElementById('counter');
    if (parseInt(i.innerHTML)<=0) {
        location.href = 'http://targetdomainname.com';
    }
    i.innerHTML = parseInt(i.innerHTML)-1;
}
setInterval(function(){ countdown(); },1000);
</script>


  




Wednesday, 8 March 2017

Automatic Images Slideshow

<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<style>
.mySlides {display:none;}
</style>
<body>

<h2 class="w3-center">Automatic Slideshow</h2>

<div class="w3-content w3-section" style="max-width:500px">
  <img class="mySlides" src="image1.jpg" style="width:100%">
  <img class="mySlides" src="image2.jpg" style="width:100%">
  <img class="mySlides" src="image3.jpg" style="width:100%">
</div>

<script>
var myIndex = 0;
carousel();

function carousel() {
    var i;
    var x = document.getElementsByClassName("mySlides");
    for (i = 0; i < x.length; i++) {
       x[i].style.display = "none";
    }
    myIndex++;
    if (myIndex > x.length) {myIndex = 1}  
    x[myIndex-1].style.display = "block";
    setTimeout(carousel, 2000); // Change image every 2 seconds
}
</script>

</body>
</html>