...

View Full Version : PHP to give Unique area only accessible by that member



Glitch100
02-17-2012, 12:27 AM
Hey all,
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.

EXAMPLE database:
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.

Thanks all!

EDIT:

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.

Thanks for quick reply, I will look into that and bump thread if I have trouble! Btw I have already made the login and stuff it was mainly the other part of having a unique page.

Fou-Lu
02-17-2012, 12:40 AM
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.

mlseim
02-17-2012, 12:42 AM
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:
http://php-login-script.com/

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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum