![]() |
[FeedBack] Could use your help :)
Class_user.php Hello, i have much to learn. Could anyone please take the time and corect me. with /*comment tags */ so i know what i did rong.. Thank you ;) PHP Code:
|
On the register function, you have in the query that the username should be set to $username, but where is that variable set?
Also, you refer to $this->db when you're calling a query, but I don't see where you set the $db variable in the class.. Also, why do you have $this->register in the beginning of the reg function? |
tanax ty for your comment but could you explain more what you are asking me :P
hum.. oh right now i get it or do i :P ? "but where is that variable set?" explain?? hum.. |
Well, your register function, could look something like this:
PHP Code:
|
hum. ok i get it
hum i will work on this.. thank you.. |
You're trying to access $this->db. I reckon that you were planning to write your own Database class. Your class is a mix of database access, output and access on user data. A class should not contain any HTML or access on superglobals like $_POST, $_GET, etc. for portability reasons. So it might be better to separate the output from the user interaction and the logic like it's done in MVC structures. SHA1 is more secure than MD5 so you should use sha1() instead of md5(). Here's how I would have realized it:
PHP Code:
PHP Code:
If you have any questions don't hesitate to ask. Thanks. :-) |
man you realy where a good helper on this ;) ty.
but i dont know i want to so bad learn and i just dont get it :S but i wont give up not this time its time to stop being lazy and start learning xD so ty dude and i might just take up your offer on asking again ;) as i said great help ty :D ps: i knew about the sha1() but i forgot what it was called so i went with md5 sorry xD ;) |
No problem. :-)
There's a pretty cool blog by sunilbhatia79 which might support you with learning PHP: Geek Files Have fun! |
| All times are GMT. The time now is 09:55 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0