0

Hi guys

I'm looking for a starting point to have a login for a website.

The situation is as follows -

I have a common product list, with 3 price bands (gold, silver, bronze)

When a gold customer logs in, I want to search the db for the products, and display the gold prices.

When a silver customer logs in, the silver prices, etc.

I already have the basic search page sorted as search.php (which doesn't return any prices).

I was thinking of having searchgold.php, searchsilver.php and searchbronze.php.

The customers must not be able to search eachothers prices.

I don't have any SSL space on my web server.

Any documentation/starting points/resources/ideas/example scripts to get me started would be greatly appreciated!

Cheers

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by benk1
0

You don't need 3 pages. Your login - I assume your using $_SESSION variables, provides all the info required. Your member table will have a 'level' (gold/silver/bronze) field. On login, just create a session array with all the useful info:

$_SESSION
$_SESSION

Use the level variable to 'filter' your searches from the products table, e.g.

$level = $_SESSION['mylogindata']['level'];
$r = mysql_query("SELECT field1,field2 FROM products WHERE level='$level'");

This is assuming that the level field in both tables can contain the same data (gold/silver/bronze).

Edited by diafol: n/a

0

Thanks for that.

I've used the session variables in nearly exactly the way you suggested.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.