|
Well, me and my friend are trying to create a online text-based strategy game in PHP/MySQL (yeah like that hasn't been done before >.>). He's the ideas guy, and I'm the one coding most of this.
I just have a few things that I need help with:
1. We would like to have a coordinate/land/influence system. By this, I mean that upon registration, the user will be given x and y coordinates on a virtual grid, from which his land ring and influence ring get calculated. The problem is, I have no idea on how to be able to calculate a person's land and ring of influence, even if I know their starting point (say, (0,0)), land ring (say, 5km each way), and influence ring (say, 30km) each way. Calculating this influence ring will be needed because it will work out when you reach someone's land borders, and influence rings may cause people from other nations riot and join you instead. I know this sounds complex, but it's an integral feature of the game. I honestly have no idea how to make it work =/
2. What sort of server-side validation would you recommend to prevent people from using SQL injection whilst logging in/registering? (I know javascrpt validation is rubbish, therefore I'm not using it). Would you recommend blocking certain certain characters, and how would you check that such characters do not occur in PHP?
3. Yet again, I want to prevent anyone compromising the security of the data, this time in the Personal Messaging system. I would like to allow users to be able to enter things like bold text and italic and etc, but in BBCode format. Would I have to then replace the [ and ] for < and > before being inserted into the MySQL database, and then just display that when the person reads a message, and then get the code to check that the user didn't enter things like <script> and similar to try and execute code on the reader's page? If so, what things would you recommend checking against?
Sorry for such long questions, but I would be really grateful if you would help, as I'm new to PHP/MySQL and therefore am not sure on how to do this. Thank you.
|