<html>
<! FileOwner.php                                              >
<! Chapter 10, Oracle Database XE PHP Web Programming         >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates how to read and convert a file    >
<! owners information on a POSIX and Windows system. It does  >
<! not trap for non-POSIX compliant Linux versions.           >
<head>
<title>
  Chapter 10 : FileOwner.php
</title>
</head>
<body>
<?php
  // Read the parameter from the URL.
  $file = $_GET["p_name"];

  //Check POSIX operating system and coverts the file owner number to name.
  if ((!ereg("Win32",$_SERVER["SERVER_SOFTWARE"])) &&
      (array_search("posix",get_loaded_extensions())))
  {
    $user = posix_getpwuid(fileowner($file));
    print $user["name"];
  }
  else
    print fileowner($file);
?>
</body>
</html>
