[PHP] How to make a good index?
Hi, im new here. I found this forum by luck I guess and is great!
I am trying to make an online game like Hattrick, popmundo or ogame... I hope most of you have heard of them some time.
The game itself is mostly done, but I have a little issue with the index or the main page. How should I do it?
I am making an html index that contains the php script, so when someone enter, the php code checks for cookies. If you are not logged in, it will show you the login page.
Now, once you have logged in, how should I get the user through the pages? I did some research and found that most sites just have a "switch" in their main pages, and they make a variable at the cookie that contains on what page you should be.
For example: you go to your character pages, the site set the cookie: location= character.
Is this correct? or there are others (and better) ways to do my main.php??
Im sorry if this is answered in another thread, i could not find it :S
I will very thankfully with every answer! ;)
Re: How to make a good index? (PHP)
i think you mean that when they login it makes them go to another page?
you can do that by making a login area and then changing the action="wqkehkjwh.php"
part
and then in the wqkehkjwh.php file check if the cookies are there or not, using the if and else command
Re: How to make a good index? (PHP)
Yes, that is what i mean, thanx.
But what do you mean by changing the action? Should I use functions to show the XX.php parts?
Re: How to make a good index? (PHP)
hmmm, just a piece of advice....
for your main page....check for the cookies if it exist, if not, go to the login page, else go to the desired page.
Re: [PHP] How to make a good index?
So, i should check the cookie every time to go to another page. Got it!
But my main question is how should i go from page to page... Hidden mentioned I must change the action, but I