<html>
<! TestOraclePHP.php                                          >
<! Chapter 2, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script demonstrates PHP Oracle connection with old    >
<! command style, which is now an alias to oci_connect()      >
<! function.                                                  >
<head>
<title>
  Test Oracle PHP Connection.
</title>
</head>
<body>
<?php
  /*
     Attempt to connect to the database.
     -----------------------------------
     OCILogon Argument #1: Oracle user schema.
     OCILogon Argument #2: Oracle user password.
     OCILogon Argument #3: Oracle database name.
  */
  if ($c = OCILogon("php","php","xe"))
  {
    // Print successful message to web page.
    echo "Successfully connected to Oracle.<br>";

    // Log off the database.
    OCILogoff($c);
  }
  else
  {
    // Assign the OCI error.
    $errorMessage = OCIError();

    // Print failure message to web page.
    echo "Oracle Connect Error.<br>" . $errorMessage[text];
  }
?>
</body>
</html>
