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

Member Avatar for diafol

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).

Thanks for that.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.