Hello Guys,
I just started learning php last week and on thing which I dont understand is how can i handle and maintain session in PHP. I used to program in ASP and the logic is you just declare ans start session in ur index page and the session is maintaines. But in PHP if i have 10 pages, i have to write <?php session_start ?> on every page.
Let me explain, I have a 2 php pages., login.php and mainsite.php.
Login.php is my first page. In this page i have written and started the session. Now if teh login is correct, I use query string ?contentbox=gallery;
So when the mainsite.php is called, it gets the URL variable and depending on the variable(contentbox) the page is displayed. SO now what i dont understand is, how to maintain and control the session.
Lets say if any users want to play, he can just type http://www.mysite.com/mainsite.php?contentbox=gallery
and the page will display as even in this form i have writted session_start, so how can i restrict the user not to manipulate with my pages.
Plz reply, I know it might be simple, but im just a beginner.
Thanks