Hello all,
I'm trying to create a php form for logging in to postgress with different level passwords and my first test with a superuser isn't working unless I specify a database name. I would like to allow superusers to log in without specifying a database so they can create new users, databases etc from a web interface. Does anyone see what I'm doing wrong in the following example?
Thanks for any help,
Ken
--------------------------------------------- I defined a super user like so
CREATE USER user_name CREATEUSER PASSWORD 'password'
Try to log in through a web form like so:
User: user_name Password: password
but the connection always fails unless I specify a database.
Relevant PHP:
<?php
function LogInUser()
{
if (isset($_POST['user_name']) &&
isset($_POST['password']))
{
$user = $_POST['user_name'];
$password = $_POST['password'];
$conn_string = "user=".$user." password=".$password." host=localhost port=5432";
$conn = pg_connect($conn_string);
if ($conn)
{
echo "login succeeded";
}
}
}
?>
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster