From angelo_rigo@yahoo.com.br Wed Jun 18 13:50:50 2003 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-- From ernest@vogelsinger.at Wed Jun 18 13:57:16 2003 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 E881F30DBA3 for ; Wed, 18 Jun 2003 13:57:16 +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 59376-03 for ; Wed, 18 Jun 2003 10:57:06 -0300 (ADT) Received: from relay11.austria.eu.net (relay11.Austria.eu.net [193.154.160.115]) by svr1.postgresql.org (Postfix) with ESMTP id DA8BF30D185 for ; Wed, 18 Jun 2003 10:57:05 -0300 (ADT) Received: from sisyphus.vogelsinger.at (vogelsinger.at [193.154.189.26]) by relay11.austria.eu.net (8.12.9/8.12.0.Beta10) with ESMTP id h5IDv4c8014400; Wed, 18 Jun 2003 15:57:04 +0200 Message-Id: <5.1.1.6.2.20030618155456.02d50d60@mail.vogelsinger.at> X-Sender: homebird@mail.vogelsinger.at X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Wed, 18 Jun 2003 15:56:57 +0200 To: angelo Rigo From: Ernest E Vogelsinger Subject: Re: login script Cc: pgsql-php@postgresql.org In-Reply-To: <20030618135038.82409.qmail@web14803.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200306/17 X-Sequence-Number: 2081 At 15:50 18.06.2003, angelo Rigo said: --------------------[snip]-------------------- >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"); --------------------[snip]-------------------- AFAIK you need to have a blank between "Location:" and the actual URL. This should work: header("Location: http://www.domain.com/pg_inic.php"); Or... what exactly do you mean with "it is not working anymore"? You might also consider asking on the PHP General list (php-general@lists.php.net). -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/