Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
02-17-2012, 12:27 AM #1
- Join Date
- Feb 2012
- Thanked 0 Times in 0 Posts
PHP to give Unique area only accessible by that member
First post; May I start by saying this forum has given invaluable help over the last couple of weeks.
Ok, first off, I aim to develop a system which, in its simplest:
1.Allows users to log in, Forget Password, and all that jumble.
2.Takes said user to their own version of, index.php.
3.On page, the user can only see their stats, and can edit only theirs. There may be a button, for example 'PURCHASE 10 ITEM1's' which if pressed will check if they can do it via looking at a database entry associated with their account.
NAME PASSWD MONEY ITEM1 ITEM2
DAVE ***** 500 4 5
By purchasing 10 item 1s it would take off their combined cost for example 100 from money.
That's all simple maths, but what I can't get my head around is how a user can just see their section and deal with their section and no one elses.
Further If implemented I am looking to have various pages like this, where only the user in question can see their records for that page.
I have tried to explain clearly, please feel free to ask questions.
I am not asking for all the code, but if you can, point me in the right direction.
Last edited by Glitch100; 02-17-2012 at 12:42 AM.
02-17-2012, 12:40 AM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
Its a simple matter of: login -> establish session variables -> pull session variables for data -> query only based on the session variables.
Simple as that. PHP was designed with the purpose to introduce dynamic content based on input. Give google a quick look for 'php mysql user tutorial'. There will likely be a lot of matches to tutorials that can take you step by step to creating a simple user system.
Users who have thanked Fou-Lu for this post:
02-17-2012, 12:42 AM #3
- Join Date
- Jun 2003
- Cottage Grove, Minnesota
- Thanked 1,096 Times in 1,087 Posts
You're doing a stand-alone site (not using Jooma or a pre-made CMS),
so I recommend you download and use this free user/register/login script:
You can customize it how you want. In fact, I've used it (just for the scripts),
and not any of the CSS, layouts or graphics. I used all my own stuff.
You will be adding more columns to their profile (than what the script uses).
Add columns for user "account balance", and anything else you need.