Anyone willing to review my source code and tell me what I'm doing right/wrong?
2 replies, posted
So you probably know about the game minecraft, well there was a new game mode and it was without a proper server list so I dicked something together in a few hours using PHP. I've been programming with PHP for a while now [i]but[/i] I am not at all a good programmer nor am I confident...
I've uploaded the project to github, really it's only a few files so I doubt there's much that could be said about it, but I'd love some feedback on the entire thing. There are a few things I've identified as being done wrong but I'd like to leave them to you guys to point out in case I'm doing them right...
[url]http://github.com/citricsquid/Minecraft-Server-List[/url]
That's the project, I'd appreciated feedback on:
- The way I've handled the files (dir structure)
- The way I've used PHP
- The way I've handled user input and validation
- Anything else you can think of
I'd really appreciated this... if you can help :-)
1. You've hardcoded the require_once() paths for common.php in the server files, Just go "../common.php" (Unless of course there is some reason I don't understand).
2. Yes it would be better to include an installer, Easy enough to just create an install.php with a form for inputting mySQL connection details, Inserting DB and then dumping to a config.php file or something.
Other then that everything seems fine.
[QUOTE=UberMouse;23839775]1. You've hardcoded the require_once() paths for common.php in the server files, Just go "../common.php" (Unless of course there is some reason I don't understand).
2. Yes it would be better to include an installer, Easy enough to just create an install.php with a form for inputting mySQL connection details, Inserting DB and then dumping to a config.php file or something.
Other then that everything seems fine.[/QUOTE]
1. My server is poorly configured (my fault) so when running via cron (as is a bunch of files there) if the paths aren't hardcoded it doesn't work.
2. I guess so, I'll do that next time :-D
Sorry, you need to Log In to post a reply to this thread.