pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
login script
2+ messages / 2 participants
[nested] [flat]

* login script
@ 2003-06-18 13:50  angelo Rigo <angelo_rigo@yahoo.com.br>
  0 siblings, 1 reply; 2+ messages in thread

From: angelo Rigo @ 2003-06-18 13:50 UTC (permalink / raw)
  To: 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.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: login script
@ 2003-06-18 13:56  Ernest E Vogelsinger <ernest@vogelsinger.at>
  parent: angelo Rigo <angelo_rigo@yahoo.com.br>
  0 siblings, 0 replies; 2+ messages in thread

From: Ernest E Vogelsinger @ 2003-06-18 13:56 UTC (permalink / raw)
  To: angelo Rigo <angelo_rigo@yahoo.com.br>; +Cc: pgsql-php

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/





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-06-18 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 13:50 login script angelo Rigo <angelo_rigo@yahoo.com.br>
2003-06-18 13:56 ` Ernest E Vogelsinger <ernest@vogelsinger.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox