Thursday, December 6, 2018

SERVER_SIDE

<?php

if (!empty($_SERVER['HTTP_CLIENT_IP'])) 
  {
    $ip_address = $_SERVER['HTTP_CLIENT_IP'];
  }

elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
  {
    $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
  }

else
  {
    $ip_address = $_SERVER['REMOTE_ADDR'];
  }
echo $ip_address;
?>



========================
<?php
   echo sprintf("<pre>%s</pre>", print_r($_SERVER, true));
?>

No comments:

Post a Comment

form validation

function formsubmit ( ) { var empname = document .getElementById ( 'emp_name' ). value ; var email = document .getElem...