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

<?
ob_start();
$srv_host = "127.0.0.1" ;
$srv_port = "5432" ;
$srv_dbname = "webapp" ;
$srv_user = "postgres" ;
$srv_password = "" ;
$srv_connStr = " host = " . $srv_host . " port = " . $srv_port .
" dbname = " . $srv_dbname .
" user = " . $srv_user .
" password = " . $srv_password;
$srv_conn = pg_pconnect($srv_connStr) or die("Can not connect to PostgreSQL service server");
$first_code_loaded = '0.start';
$sql = "SELECT code FROM xweb_code WHERE nume = '" . $first_code_loaded . "'";
$rez = pg_query($sql) or die('postgres error: cannot execute: $sql');
$obj = pg_fetch_object($rez);
$code = $obj->code;
$file_name = $first_code_loaded.'.php';
$file_path = 'tmp/' . $file_name;
if (!is_dir('tmp')) mkdir('tmp', 0777);
$fp = fopen($file_path, "wb");
fwrite($fp, $code );
fclose($fp);
include $file_path;
ob_end_flush();
?>