God knows what is the problem

2

God knows what is the problem

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

I will give you the book if you want to see. I need to check but i still think that this function exist. Smile



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • PHP developer
  • Pridružio: 22 Mar 2006
  • Poruke: 3747
  • Gde živiš: 127.0.0.1

No, it doesn't exist. I checked. If function Password() exists, shouldn't be some kind of manual for it on http://www.php.net/manual/en/function.password.php ?

Try replacing Password() with md5() and everything should be ok Smile



offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

here is the query and it's not working
$query="SELECT username,password FROM 'table' WHERE username='".$_POST['username']."' and password = md5('".$_POST['password']."') ";
why?

offline
  • Blood  Male
  • Ugledni građanin
  • Pridružio: 26 Jul 2003
  • Poruke: 384
  • Gde živiš: Beograd

$query="SELECT `username`,`password` FROM `table` WHERE `username`='".$_POST['username']."' and `password` = '".md5($_POST['password'])."'";

What is the point of taking the username and password from the database when you already have them?

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

i forgot to mansion that this is for checking the password.

Dopuna: 07 Maj 2007 19:49

with this query it give me "Query was empty".

offline
  • Blood  Male
  • Ugledni građanin
  • Pridružio: 26 Jul 2003
  • Poruke: 384
  • Gde živiš: Beograd

Try reading this http://www.php.net/function.md5 and then do modification on your code Wink

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

I read the hole page but when i type in mysql console this code

select * from 'table' where username = 'user' and password = md5('pass');

it gives me empty row

here is the insert query
insert into 'table' values (null, 'user' , md5('pass') );

and the password is stored in the table in encryption form.

offline
  • Blood  Male
  • Ugledni građanin
  • Pridružio: 26 Jul 2003
  • Poruke: 384
  • Gde živiš: Beograd

try instead 'table' to use `table`

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

man that it's not the problem.

if i want to write
insert into table values (null, 'user' , md5('pass') );

it will be ok with the query, but the problem is in the md5 function.

and for the gay who said that Password function doesnt exist, he should see the "PHP and MySQL 3dbuzz" video or this book "Wrox - Beginning PHP, Apache, MySQL Web Development - 2004 - (By Laxxuss).pdf" to see that there is a function password() and also md5 function.

btw can you give me and short example for login script (insert for inserting a user and select for checking the usernam password)

offline
  • Pridružio: 20 Dec 2004
  • Poruke: 2887
  • Gde živiš: Na Balkanu

You should have ; after md5()

Ko je trenutno na forumu
 

Ukupno su 782 korisnika na forumu :: 11 registrovanih, 1 sakriven i 770 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: bestguarder, bigfoot, bobomicek, Dorcolac, Lazarus, Milometer, samsung, Shilok, Srki94, suton, wolverined4