So far the PHP side of the game is going quite well. I have a solid base for my registration/login system that successfully sends an email to the player for activation and inserts the players data into my database tables.
Now I find myself at a bit of a crossroads because I really want this game to use AJAX to update the display. So when something happens like gaining resources or getting attacked happens, the appropriate things will update without having to reload the page.
The problem I'm having are these:
First, I don't know AJAX yet. I'm reading guides and watching tutorials but none of them seem to explain it in a way that allows me to get my head around it.
Second, I'm trying to figure out the smart way to store the player data that is needed in each of the pages. The solutions I came up with were 1. store the values in the session at login. 2. Store the variables in a separate script and require that script on the needed pages. 3. Make database calls on each and every page that requires the data.
The first thing I tried was the script that would be required by each of the pages that had all the database entries needed already setup in variables so that all I would have to do is call them from that script.
No luck so far. It seems that whenever I call them the variable doesn't have string data in it anymore. No idea why.
What I really need right now is someone to help get me on the right track.
Please let me clarify, I am in no way asking for someone to do my work for me. I wouldn't want that, this is my project and I want to do the work. But I do need someones help getting out of the rut that I find myself in.
So basically I need some advice on what to do about updating each pages fields with the database information, how I should store it and whatnot. And some help getting my head around updating the fields with AJAX.
I don't want to get bogged down and loss hope in this rut because I found that as I wrote the login and registration script in PHP, things became a lot clearer and I started to grasp a lot of things that I didn't before. So I'm hoping to keep my momentum up.
Thanks guys! I look forward to learning from you!
NOTE: I didn't include any scripts because I didn't know exactly where this would go so I figured I would get some input and then post the relevant scripts as needed.

New Topic/Question
Reply


MultiQuote








|