con%00.php 622 B

123456789101112131415161718192021222324252627
  1. <?php
  2. ini_set('display_errors', 1);
  3. error_reporting(E_ALL);
  4. function StartCon(){
  5. $db = "(DESCRIPTION =
  6. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.211)(PORT = 1521))
  7. (CONNECT_DATA =
  8. (SERVER = DEDICATED)
  9. (SERVICE_NAME = ORCLCDB.localdomain)
  10. ))" ;
  11. $usr = 'eaton';
  12. $pwd = 'eaton';
  13. $conn = oci_connect ($usr, $pwd, $db);
  14. if (!$conn) {
  15. $m = oci_error();
  16. echo $m['message'], "\n";
  17. exit;
  18. }
  19. return $conn;
  20. }
  21. function CloseCon($conn){
  22. oci_close($conn);
  23. }
  24. ?>