Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old July 15th, 2003, 12:57 PM
angelorigo angelorigo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: porto alegre rs brasil
Posts: 3 angelorigo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 16th, 2003, 03:34 AM
filefrog filefrog is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: West Peoria, IL
Posts: 62 filefrog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to filefrog
RE: user authenticating system with postgresql

Usually, a username / password combination works...

Reply With Quote
  #3  
Old July 16th, 2003, 09:54 AM
angelorigo angelorigo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: porto alegre rs brasil
Posts: 3 angelorigo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: RE: user authenticating system with postgresql


Quote:
Usually, a username / password combination works...

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);
?>

Reply With Quote
  #4  
Old July 16th, 2003, 10:00 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 11979 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 50 m 37 sec
Reputation Power: 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.

Reply With Quote
  #5  
Old July 16th, 2003, 11:04 AM
angelorigo angelorigo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: porto alegre rs brasil
Posts: 3 angelorigo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: RE: user authenticating system with postgresql


Quote:
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.


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") )

Reply With Quote
  #6  
Old July 16th, 2003, 08:43 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: 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?


this is probably register_globals problem.

look it up here: http://yu.php.net/globals

and here: http://php.net/register_globals

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > user authenticating system with postgresql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway