<?php

//$file = fopen("log.txt", "w");   /// BORRAR LOG
//fwrite($file, "Error $error". PHP_EOL);
//fclose($file);

$config = require ('config.php');
$conexion=$config['conexion']; 

$user=$_GET["user"];
$pass=$_GET["pass"];

$conn = pg_pconnect("$conexion");

$existe='N';
$sql="select user,pass from login where usuario='".$user."' and pass='".$pass."'";

$result = pg_query($conn, $sql);
if ($row = pg_fetch_array($result, NULL, PGSQL_ASSOC)) {
	echo '{"status":"ok"}';
}
else{
	echo '{"status":"error"}';
}

pg_free_result($result);
pg_close($conn);
	
?>