Thursday, January 26, 2017

Creating multiple name server

If we want to create name server under www.esteemcorporation.com to different server but esteem it self hosted another server.


Example i need to use


This 2 name server for a server IP 00.11.22.33.44


Ns1.esteemcorporation.com
Ns2.esteemcorporation.com


This 2 for 55.66.77.88.99
Ns5.esteemcorporation.com
Ns6.esteemcorporation.com


But esteemcorporation.com is hosted another server.


Now create child name server from esteemcorporation.com domain panel and assign IP



Now go to WHM/Cpanel of esteemcorporation.com and find DNS zone edit option. Add A record to ns5.esteemcorporation.com and assign IP.


Now we can use NS5.esteemcorporation.com   as a nameserver which pointed to 55.66.77.88 server.

Wednesday, December 28, 2016

Print header and footer on every printed page of a document HTML CSS

If you take the element that you want to be the footer and set it to be position:fixed and bottom:0, when the page prints it will repeat that element at the bottom of each printed page. The same would work for a header element, just set top:0 instead.


For example:
<div class="divFooter">Printed By Sharif</div>
CSS:
@media screen {
  div.divFooter {
    display: none;
  }
}
@media print {
  div.divFooter {
    position: fixed;
    bottom: 0;
  }
}

Monday, November 21, 2016

Calculate age from date of birth php

Most easiest way to find age (years/month)

 function return_age($dob){  
   $from = new DateTime($dob);  
   $to  = new DateTime('today');  
   if( $from->diff($to)->y!=0){  
        echo $from->diff($to)->y." Years";  
   }  
   else{  
     echo $from->diff($to)->m." Months";  
   }  
 }  

now use it echo return_age('2010-02-01');

if  age less than one year then it'll show month like 9 Months.

Total Pageviews