Tardiba - The Tasmanian Devil Database Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
985 B

  1. <?
  2. ob_start();
  3. $srv_host = "127.0.0.1" ;
  4. $srv_port = "5432" ;
  5. $srv_dbname = "webapp" ;
  6. $srv_user = "postgres" ;
  7. $srv_password = "" ;
  8. $srv_connStr = " host = " . $srv_host . " port = " . $srv_port .
  9. " dbname = " . $srv_dbname .
  10. " user = " . $srv_user .
  11. " password = " . $srv_password;
  12. $srv_conn = pg_pconnect($srv_connStr) or die("Can not connect to PostgreSQL service server");
  13. $first_code_loaded = '0.start';
  14. $sql = "SELECT code FROM xweb_code WHERE nume = '" . $first_code_loaded . "'";
  15. $rez = pg_query($sql) or die('postgres error: cannot execute: $sql');
  16. $obj = pg_fetch_object($rez);
  17. $code = $obj->code;
  18. $file_name = $first_code_loaded.'.php';
  19. $file_path = 'tmp/' . $file_name;
  20. if (!is_dir('tmp')) mkdir('tmp', 0777);
  21. $fp = fopen($file_path, "wb");
  22. fwrite($fp, $code );
  23. fclose($fp);
  24. include $file_path;
  25. ob_end_flush();
  26. ?>