|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
user authenticating system with postgresql
Hi
I am searching and developing for a user /authenticating system with php4.2.2 and postgresql, i would like to know if you have any good guideline or system. Best regards |
|
#2
|
|||
|
|||
|
RE: user authenticating system with postgresql
Usually, a username / password combination works...
|
|
#3
|
|||
|
|||
|
RE: RE: user authenticating system with postgresql
Quote:
Yes it use to work after the php upgrade it just return the section saying bad password, ecven with the correct password, do you know a better code? thank´s a lot! <?php $db = pg_connect("dbname=db user=db"); $nome = $_POST['nome']; $senha = $_POST['senha']; $sql = "SELECT * FROM table 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">Usuário não encontrado!</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">A sua senha está incorreta!</p>"; echo"<p align="center"><a href="index.html">Voltar</a></p>"; //echo"</body></html>"; } else { setcookie(""); header("location: http://www.website.com/autenticacao/pg_inic.php") ; //readfile("pg_inic.php"); } } pg_close($db); ?> |
|
#4
|
||||
|
||||
|
RE: user authenticating system with postgresql
I would use
SELECT * FROM table WHERE name='$name' AND password='$password' Then check how many rows it returns. If 1, correct, otherwise something wrong. |
|
#5
|
|||
|
|||
|
RE: RE: user authenticating system with postgresql
Quote:
I really miss the pass check, now it´s on the code . But it returns 1 and the corrects user and pass that are stored on the server, and still says bad password. Is this line correct? if ( $senha!=pg_result($resultado, 0, "senha") ) |
|
#6
|
|||
|
|||
|
RE: RE: RE: user authenticating system with postgresql
Quote:
this is probably register_globals problem. look it up here: http://yu.php.net/globals and here: http://php.net/register_globals |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > user authenticating system with postgresql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|