View Full Version : views of page
Bengal313
05-29-2003, 07:46 PM
I have a MYSQL database that has a table that has username & password. Is there a way I can create a page (menu.php) that before loading will ask for a username and password and based on that will display only the links that are assigned to that user. An example of this would be great help. Thanx.......
Nightfire
05-29-2003, 08:54 PM
Give the user another field, call it auth or something, then give the user a code number 1 - 5 (or however many diffferent link combos there'll be). Then do somethign like this:
session_start();
$sql = "SELECT `auth` FROM users WHERE username='$_POST[username]'";
$result = mysql_query($sql);
$fetch = mysql_fetch_object($result);
if($fetch->auth == "1"){
$links = "<a href='fubarpage'?Blah</a>";
$_SESSION['auth'] = $links;
}
elseif($fetch->auth == "2"){
$links = "<a href='anotherfubarpage'>blah2</a>";
$_SESSION['auth'] = $links;
}
etc etc
Bengal313
05-29-2003, 09:57 PM
I have about 40 different links. So there are lot of combos. Is there a easier way. Because I know I would have to hard code every possible combination in the page, right.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.