![]() |
Help with classes
I just followed some tutorials about classes in PHP and I made this:
PHP Code:
|
Seems fine, what error does it give?
|
Hm...nvm,strange enough it works now! :D
Maybe the server had some delay or something. |
A bit of constructive criticism, if you don't mind. I understand that you're just starting out with classes and objects.
When you design a class, it should be functionally independent and fluid. You should consider not hard-coding anything like the server address / name into the class, and you should definitely never allow a class to kill a script or interact with the script outside itself. A better way might be something more like this: PHP Code:
Hope that helps, let me know if you have any questions. |
I understand what you mean, SOCKS, but if that were the case and you're not to hard-code anything into your classes, surely class constants would be a thing of the past? Are you saying that they are now unnecessary?
|
Quote:
|
thanks for explaining sock :)
I got another problem... It's something totally different,I'm making a file editor but problems with the login. The pass and username are in the config.php,but when entering a wrong password it logs me in =/ PHP Code:
|
| All times are GMT. The time now is 03:29 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0