login script

From: angelo Rigo <angelo_rigo(at)yahoo(dot)com(dot)br>
To: pgsql-php(at)postgresql(dot)org
Subject: login script
Date: 2003-06-18 13:50:38
Message-ID: 20030618135038.82409.qmail@web14803.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi !

I do have a login script in pgsql/php
and it is not working anymore. i develop in php 4.0.6 and now i am using php4.2.2. My doubt is about these lines:
setcookie("");
header("Location:http://www.domain.com/pg_inic.php");

that are set when the user and pass are correct. These lines does not work anymore with php4.2.2?
Is there an alternative to do this?
thank´s in advance


<?php
$db = pg_connect("dbname=db user=user");
$nome = $_POST['nome'];
$senha = $_POST['senha'];
$sql = "SELECT * FROM usuario WHERE nome ='$nome';";
$resultado = pg_exec($db, $sql);
$linhas = pg_numrows($resultado);
if($linhas==0) //testa se a consulta retornou algum registro
{
echo"<html><body>";
echo"<p align=\"center\">User not found!</p>";
echo"<p align=\"center\"><a href=\"index.html\">Voltar</a></p>";
echo"</body></html>";
}
else
{
if ($senha != pg_result($resultado, 0, "senha")) //confere senha
{
echo"<html><body>";
echo"<p align=\"center\">Incorrect password</p>";
echo"<p align=\"center\"><a href=\"index.html\">Voltar</a></p>";
echo"</body></html>";
}
else {
setcookie("");
setcookie("");
header("Location:http://www.comain.com/pg_inic.php");
}
}
pg_close($db);
?>

---------------------------------
Yahoo! Mail
Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção contra spam.

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Ernest E Vogelsinger 2003-06-18 13:56:57 Re: login script
Previous Message Christopher Kings-Lynne 2003-06-16 05:12:36 Re: Cleaning up aborted transactions