I am new to PHP and have been using Dreamweaver to develop my blog. When a user logs into the website I want there "user_id" to be stored but Dreamweaver's Log In User Server Behavior doesn't store a session variable for the "user_id". I tried modifying the code slightly to add a MM_UserID session variable but the "user_id" isn't being stored, I think. When a user adds a comment the "user_id" is supposed to be filled into the form with the MM_UserID session variable into the hidden field. Here's my code below. The red text is what I added into the code. I'd appreciate the help since this problem has been bugging me for 1 week. [font=Verdana]<?php require_once('../Connections/connBlog.php'); ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = "al_levelid"; $MM_redirectLoginSuccess = "home.php"; $MM_redirectLoginFailed = "failed.php"; $MM_redirecttoReferrer = true; mysql_select_db($database_connBlog, $connBlog); $LoginRS__query=sprintf("SELECT [color=red]user_id[/color], user_sname, user_pass, al_levelid FROM user_tbl WHERE user_sname='%s' AND user_pass='%s'", get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $connBlog) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = mysql_result($LoginRS,0,'al_levelid'); //declare three session variables and assign them $_SESSION['MM_Username'] = $loginUsername; [color=red]$_SESSION['MM_UserID'] = $loginFoundUser['user_id'];[/color] $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && true) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?>[/font]