<?php
$conn=mysqli_connect("localhost","root","","portfolio");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
$set =  mysqli_query($conn, "SELECT * FROM `contact`");
$get_set = mysqli_fetch_array( $set);



$sitename = $get_set['website_name'];
$sitetag = $get_set['tagline'];
$sitekey = $get_set['keywords'];
$siteaddress = $get_set['address'];
$siteemail = $get_set['email'];
$sitephone = $get_set['phone'];
//$sitegooglemap = $get_set['googlemap'];
$siteicon = $get_set['icon'];
$sitewame = $get_set['wame'];



$setuser =  mysqli_query($conn, "SELECT * FROM `profile`");
$get_setuser = mysqli_fetch_array( $setuser);

$person = $get_setuser['name'];

$setsocial =  mysqli_query($conn, "SELECT * FROM `social`");
$get_setsocial = mysqli_fetch_array( $setsocial);

$facebook = $get_setsocial['facebook'];
$youtube = $get_setsocial['youtube'];
$Linkedin = $get_setsocial['Linkedin'];
$twitter = $get_setsocial['twitter'];

//$mail=  mysqli_query($conn, "SELECT * FROM `mail` where id='1'");
//$mailer = mysqli_fetch_array( $mail);


?>
<?php
//whether ip is from share internet
if (!empty($_SERVER['HTTP_CLIENT_IP']))   
  {
    $ip_address = $_SERVER['HTTP_CLIENT_IP'];
  }
//whether ip is from proxy
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))  
  {
    $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
  }
//whether ip is from remote address
else
  {
    $ip_address = $_SERVER['REMOTE_ADDR'];
  }
//echo $ip_address;
?>