<html>
<! RealPath.php                                               >
<! Chapter 10, Oracle Database XE PHP Web Programming         >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates a how to find and read a file     >
<! path.                                                      >
<head>
<title>
  Chapter 10 : RealPath.php
</title>
</head>
<body>
<?php
  // Read the parameter from the URL.
  $file = $_GET["p_name"];

  // Expand the relative path to an absolute path.
  $file_name = realpath($file);

  // Parse the directory minus the file.
  $dir = dirname($file_name);

  // Print the absolute file name and directory path.
  print $file_name."<br>".$dir;
?>
</body>
</html>
