X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9A4E530DB90 for ; Wed, 18 Jun 2003 13:50:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 56470-06 for ; Wed, 18 Jun 2003 10:50:39 -0300 (ADT) Received: from web14803.mail.yahoo.com (web14803.mail.yahoo.com [216.136.224.219]) by svr1.postgresql.org (Postfix) with SMTP id BDFEA30DC5A for ; Wed, 18 Jun 2003 10:50:37 -0300 (ADT) Message-ID: <20030618135038.82409.qmail@web14803.mail.yahoo.com> Received: from [200.219.69.252] by web14803.mail.yahoo.com via HTTP; Wed, 18 Jun 2003 10:50:38 ART Date: Wed, 18 Jun 2003 10:50:38 -0300 (ART) From: =?iso-8859-1?q?angelo=20Rigo?= Subject: login script To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-220997998-1055944238=:81214" Content-Transfer-Encoding: 8bit X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=BAYES_30, HTML_20_30 X-Spam-Level: X-Archive-Number: 200306/16 X-Sequence-Number: 2080 --0-220997998-1055944238=:81214 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 "; echo"

User not found!

"; echo"

Voltar

"; echo""; } else { if ($senha != pg_result($resultado, 0, "senha")) //confere senha { echo""; echo"

Incorrect password

"; echo"

Voltar

"; echo""; } 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. --0-220997998-1055944238=:81214 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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. --0-220997998-1055944238=:81214--