I use a plug in password app for Dreamweaver to control access to a set of pages.
The login works fine, but what I want to do is direct users once logged in to a page that is specific to them, contains their details if you like.....is this hard to do?
The login code is shown below (The "Buzzinet PHPLS01" stuff is the plug-in codes)
<?php
// Buzz inet PHPLS01 - Login & Set Session
// Enable Session Support for page
session_start();
?>
<?php require_once('Connections/blah.php'); ?>
<?php
// Buzz inet PHPLS01 - Login & Set Session - Recordset
$myUsername_rsLogin = "0";
if (isset($HTTP_POST_VARS['username'])) {
$myUsername_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['username'] : addslashes($HTTP_POST_VARS['username']);
}
$myPassword_rsLogin = "0";
if (isset($HTTP_POST_VARS['password'])) {
$myPassword_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['password'] : addslashes($HTTP_POST_VARS['password']);
}
mysql_select_db($database_blah, $blah);
// Verify Login is correct
$query_rsLogin = sprintf("SELECT username, password FROM login WHERE username = '%s' AND password = '%s'", $myUsername_rsLogin,$myPassword_rsLogin);
$rsLogin = mysql_query($query_rsLogin, $blah) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);
// Buzz inet PHPLS01 - Login & Set Session - Main
if($HTTP_POST_VARS['action']=="login"){
if($totalRows_rsLogin==0){
$errorMessage = "Please Try Again";
mysql_free_result($rsLogin);
} else {
mysql_free_result($rsLogin);
session_register("log1");
$log1 = $HTTP_POST_VARS['username'];
header("Location: welcome.php");
}
}
?>
The table contain an "id" field (Unique Primary Key)