Login session variable - pls help before i slot myself

im brand new to this guys and really struggling with logging
in a member to their particular account as opposed to a general
members section using dreamweavers login application and some basic
php coding.
i just cant seem to figure it out it (im stuck on the session
variables i think..) and unfortunately my php is very poor at them
moment!
pls HELP!!
below is the dreamweaver generated code from its basic login
application.
im using it in a dreamweaver template so im not sure if thats
the issue but bascially im using 2 SQL tables i constructed to
achieve this-
1.) tblaccesslevel
intLevelID (unsigned + auto increment + primary key)
txtAccess
(ive allocated various numerical access levels into
txtAccess. ie. 1-7
and
2.) tblplayeraccount
intUserID (unsigned + auto increment + primary key)
txtFirstName
txtLastName
txtEmailAddress
txtPassword
intAccessLevel
(ive generated 2 users in the above table tp test)
in dreameavers server behaviors the recordset generated by
the login server behavior simply says Log In User
obviously i need a session variable somewhere to get the
intUserId....
also a relationship needs to be generated in the sql
statement to connect the intAccessLevel but i think i can manage
that (i think..)
below is the code this application generated -
if someone can give me some hints or if they've done
something similiar pls provide the required code ...it would be a
huge help!! i dont know what im doing wrong!!!
<?php require_once('../Connections/Rugby.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['emailaddress'])) {
$loginUsername=$_POST['emailaddress'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "intAccessLevel";
$MM_redirectLoginSuccess = "../player_home.php";
$MM_redirectLoginFailed = "../failed.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_Rugby, $Rugby);
$LoginRS__query=sprintf("SELECT txtEmailAddress, txtPassword,
intAccessLevel FROM tblplayeraccount WHERE txtEmailAddress='%s' AND
txtPassword='%s'",
get_magic_quotes_gpc() ? $loginUsername :
addslashes($loginUsername), get_magic_quotes_gpc() ? $password :
addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $Rugby) or
die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'intAccessLevel');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
header("Location: " . $MM_redirectLoginSuccess );
else {
header("Location: ". $MM_redirectLoginFailed );
?>

Are you wanting to redirect them to a specific page based on
their username or to the same page with dynamic content based on
their username?

Similar Messages

  • Undefine variable pls help

    Hi all,
    I executed a script from sqlplus which included a && prameter.I executed completely.Now I want to execute it for second time but it does not free that && variable and do not ask for it from me.
    I cleared buffer but no chance.What should I do to undefine this in the same session?
    Note: I NEEDed that to be && in original scripts because of many times of using it
    Pls help
    S

    oraclehema wrote:
    like this..?I do it like that :SQL> col myvar new_value myvar
    SQL> select 'value1' myvar from dual;
    MYVAR
    value1
    1 ligne selectionnee.
    SQL> select '&&myvar.' test from dual;
    TEST
    value1
    1 ligne selectionnee.
    SQL> undefine myvar
    SQL> select '&&myvar.' test from dual;
    Entrez une valeur pour myvar : value2
    TEST
    value2
    1 ligne selectionnee.And it's UNDEFINE not UNDEFINE<u><b><font color="#FF0000">D</font></b></u>...

  • Urgent: Sessions problem pls help me

    Hi all,
    Its already late to post this problem.pls help me urgently.
    I have a servlet & two jsp's. first i request servlet, it processes something and forwards request to my first jsp. In that jsp on a button click, i'm displaying a new popup by calling showModalDialog. this dialog gets data from the same servlet but it forwards to my second jsp.(second jsp can be seen in dialog)
    Now if i submit form from my second(dialog) jsp, the servlet reports that session has expired. I tried a lot but invain. any one who helps me is appreciated well by all of our forum.
    waiting 4 u r reply,

    It could be that you have cookies turned off and you're not using URL Rewriting.
    In J2EE, the first time your browser makes a request to the server, the server responds and appends a SESSION_ID parameter to the request as well as storing a cookie with the SESSION_ID.
    The second time your browser makes a request, the server checks for the cookie. If it doesn't exist it checks for the parameter. If neither exist the server assumes its the first time your browser has made a request and behaves as describe in the previous paragraph.
    In your case when you submit the form if you have disabled cookies and the action attribute doesn't have the SESSION_ID paramter appended to the url, the browser will assume it's a first request. The user will not be logged in, hence your session has expired error.
    To fix this you need to encode the URL in your JSP. You can use the struts html:rewrite tag or the HttpServletReponse.encodeURL method, or if you're using JSP 2.0 the JSTL c:url tag.

  • Login Session Variable Problem

    I've created a simple login using the inbuilt DW suite, but I don't seem to be able to display the session variable after they login.
    On the success page it should filter the RS based on the Username and also display the Username etc on the page but nothing is shown. I tested the success page in DW and entered a value for the session var and it works fine, all I can think of is that the session is empty, not coming through, but I'm clueless.
    Any ideas?
    <<<<<LOGIN PAGE>>>>>
    <?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 = "";
      $MM_redirectLoginSuccess = "login_successful.php";
      $MM_redirectLoginFailed = "login.php";
      $MM_redirecttoReferrer = true;
      mysql_select_db($database_connpbxlogin, $connpbxlogin);
      $LoginRS__query=sprintf("SELECT UserName, UserPassword FROM Users WHERE UserName=%s AND UserPassword=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $connpbxlogin) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;     
        if (isset($_SESSION['PrevUrl']) && true) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <<<<<SUCCESS PAGE>>>>>
    $colname_LoggedRS = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_LoggedRS = $_SESSION['MM_Username'];
    mysql_select_db($database_connpbxlogin, $connpbxlogin);
    $query_LoggedRS = sprintf("SELECT * FROM Users WHERE UserName = %s", GetSQLValueString($colname_LoggedRS, "text"));
    $LoggedRS = mysql_query($query_LoggedRS, $connpbxlogin) or die(mysql_error());
    $row_LoggedRS = mysql_fetch_assoc($LoggedRS);
    $totalRows_LoggedRS = mysql_num_rows($LoggedRS);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    </p>
    <p>username: <?php echo $row_LoggedRS['UserFirstName']; ?></p>
    <p>email: <?php echo $row_LoggedRS['UserEmail']; ?></p>
    <p>Session Data:
      <?php echo $_SESSION['MM_Username']; ?></p>
    </body>
    </html>
    <?php
    mysql_free_result($LoggedRS);
    ?>

    Does your success page begin with session_start()?

  • Session report pls help me

    hi, i hv create a excel report, in this report perhour how many user connect database
    i want a query , how can find out current user i hv run followin qurery
    select count(*) from v$session
    where username='PROD';
    it that correct query or not pls reply me

    It will give you the number of sessions connected as of now!!. If you want the history of connections in last one hour then you need to write your code to trap user connections

  • Session Variables - Need Help

    Hi,
    I am working on a requirement - I need to filter one subject area based on users.
    I want to know how can we populate a variable from database with comma separated values.
    Example - In the database the table is something like this
    Profit Center Name Profit Center Number
    A 105
    B 106
    C 107
    D 108
    Requirement is For - User X - Data for 105 and 106
    For - User Y - Data for 107 and 108.
    How can I populate a variable with comma separated values. Because I want to use IN clause in the filter conditions like 'IN(105,106)'.
    So I need a variable with comma separated values so that I can use
    'IN VALUEOF(<variable>)'
    Any inputs? Or any other easy way to achieve this?
    Thanks in advance,
    Prashanth.

    Hi,
    I am working on a requirement - I need to filter one subject area based on users.
    I want to know how can we populate a variable from database with comma separated values.
    Example - In the database the table is something like this
    Profit Center Name Profit Center Number
    A 105
    B 106
    C 107
    D 108
    Requirement is For - User X - Data for 105 and 106
    For - User Y - Data for 107 and 108.
    How can I populate a variable with comma separated values. Because I want to use IN clause in the filter conditions like 'IN(105,106)'.
    So I need a variable with comma separated values so that I can use
    'IN VALUEOF(<variable>)'
    Any inputs? Or any other easy way to achieve this?
    Thanks in advance,
    Prashanth.

  • Help before i shoot myself!  Moving Data

    I have a 2009 macbook pro running lion and a 2011 imac running snow leopard (just delivered today) It's a long story. However, what im trying to do is copy what is currently on my macbook pro in lion (this is all current info) and move everything to my imac, running snow leopard.  The problem that i am having is im tryin to restore my imac from my macbook pro via migration assistant and thats not worked at all.  The imac is kinda saying it wont do it coz the backup its from a different machine.  I just want to take whats on my 2009 macbook pro running lion and move it all to (and over-right) whats currently running on my 2011 imac running snow leopard to bring it up to date with my macbook pro.
    I know this is probably not difficult to someone looking in right now, but ive spent all bloody day on it!  Please any help you can ive will be really appreciated.
    Thank you!!

    You seem to be describing two different things here: one is that you want to Restore your iMac with waht's on your MBP, and the other that you want to move some date to the iMac from the MBP. Those are two contradictory things, and one of them won't work.
    If you are trying to Restore your iMac from the MBP (move everything, including the OS) it may not work. Since no 2011 iMacs shipping since July come with Snow Leopard installed, that leaves some doubt as to what you have on that machine, and how you got it.
    But in any case, if you just want to move some data from the MBP to the iMac, instead of messing around with Migration Assistant, why not just connect the two computers via Ethernet and do a straight Finder copy from one to the other?

  • Pls Help. i really screwed myself

    I just accidentally erased one of my internal drives using disk utility Mac OS Extended (Journaled) "used the default securty option". Is there a way to recover this drive? Thanks to anyone who responds.

    Sorry but probably not. To have any hope of recovering your tracks, though, you need to immediately stop using your system and then go out and get a copy of a recovery tool such as Data Rescue (Prosoft Engineering), or File Salvage (SubRosaSoft). The chances generally aren't really good even so, particularly with Mac OS X which reuses space much differently than did earlier versions of Mac OS, but short of sending your drive to a data recovery service (expensive and by no means guaranteed), such utilities are your only hope.
    Note that the more you use your system before you attempt recovery, the more likely it is that the system will overwrite the sections of the drive where the data you want to recover is stored, rendering it unrecoverable by any means. You should therefore stop using the system completely until you get and try to use one of the file recovery tools.
    Good luck.

  • Need Help With Redirect That Uses Session Variable

    I am new to dynamic sites, php, and developer toolbox, but I have been able to create a login site using the different form wizards fairly easily (in CS3 with Developers toolbox).
    <br />
    <br />I am trying to set a server behavior on a page that redirects the user to a new page if a session variable matches a recordset.
    <br />
    <br />I was using an extension (PHP Sessions - http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;extid=681308 ) that worked great, but when I installed developers toolbox, it stopped working (get error message about runtime/MX environment).
    <br />
    <br />Ive been struggling for days and this is what Ive come up with so far:
    <br />------------------------------------
    <br />session_start();
    <br />if (!isset($HTTP_SESSION_VARS[$_SESSION['kt_firstname']]) || $HTTP_SESSION_VARS[$_SESSION['kt_firstname']] = $row_Recordsetfname['firstname']) {
    <br /> header ("Location: ../firstname/firstname1.php");
    <br />}
    <br />------------------------------------
    <br />
    <br />It redirects regardless of the match. Any ideas on what I can do to get this working? Here is all of the code (with block from above inserted) up until the doc type:
    <br />------------------------------------
    <br /><?php require_once('../Connections/project1.php'); ?>
    <br /><?php<br />// Load the tNG classes<br />require_once('../includes/tng/tNG.inc.php');<br /><br />// Make unified connection variable<br />$conn_project1 = new KT_connection($project1, $database_project1);<br /><br />//Start Restrict Access To Page<br />$restrict = new tNG_RestrictAccess($conn_project1, "../");<br />//Grand Levels: Any<br />$restrict->Execute();<br />//End Restrict Access To Page<br /><br />if (!function_exists("GetSQLValueString")) {<br />function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") <br />{<br />  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;<br /><br />  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);<br /><br />  switch ($theType) {<br />    case "text":<br />      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />      break;    <br />    case "long":<br />    case "int":<br />      $theValue = ($theValue != "") ? intval($theValue) : "NULL";<br />      break;<br />    case "double":<br />      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";<br />      break;<br />    case "date":<br />      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />      break;<br />    case "defined":<br />      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;<br />      break;<br />  }<br />  return $theValue;<br />}<br />}<br /><br />// FELIXONE - 2002   SB by Felice Di Stefano - www.felixone.it<br />session_start();<br />if (!isset($HTTP_SESSION_VARS[$_SESSION['kt_firstname']]) || $HTTP_SESSION_VARS[$_SESSION['kt_firstname']] = $row_Recordsetfname['firstname']) {<br />  header ("Location: ../firstname/firstname1.php");<br />}<br /><br />$colname_Recordsetfname = "-1";<br />if (isset($_SESSION['kt_user_name'])) {<br />  $colname_Recordsetfname = $_SESSION['kt_user_name'];<br />}<br />mysql_select_db($database_project1, $project1);<br />$query_Recordsetfname = sprintf("SELECT firstname FROM registration WHERE user_name = %s", GetSQLValueString($colname_Recordsetfname, "text"));<br />$Recordsetfname = mysql_query($query_Recordsetfname, $project1) or die(mysql_error());<br />$row_Recordsetfname = mysql_fetch_assoc($Recordsetfname);<br />$totalRows_Recordsetfname = mysql_num_rows($Recordsetfname);<br /><br />$colname_Recordset1 = "-1";<br />if (isset($_SESSION['kt_user_name'])) {<br />  $colname_Recordset1 = $_SESSION['kt_user_name'];<br />}<br />mysql_select_db($database_project1, $project1);<br />$query_Recordset1 = sprintf("SELECT `Date` FROM registration WHERE user_name = %s", GetSQLValueString($colname_Recordset1, "text"));<br />$Recordset1 = mysql_query($query_Recordset1, $project1) or die(mysql_error());<br />$row_Recordset1 = mysql_fetch_assoc($Recordset1);<br />$totalRows_Recordset1 = mysql_num_rows($Recordset1);<br />?>
    <br />
    <br />------------------------------

    I am new to adobe toolbox... I ve created a ligin page but not sure how to pass the session variable. I am trying to direct successful login to a page like... index.php?id=filter
    <br />
    <br />been struggling all day with this. Please help!!!
    <br />
    <br /><?php require_once('Connections/comm.php'); ?>
    <br /><?php<br />// Load the common classes<br />require_once('includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("");<br /><br />// Make unified connection variable<br />$conn_comm = new KT_connection($comm, $database_comm);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$formValidation->addField("kt_login_user", true, "text", "", "", "", "");<br />$formValidation->addField("kt_login_password", true, "text", "", "", "", "");<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />// Make a login transaction instance<br />$loginTransaction = new tNG_login($conn_comm);<br />$tNGs->addTransaction($loginTransaction);<br />// Register triggers<br />$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");<br />$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");<br />// Add columns<br />$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");<br />$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");<br />$loginTransaction->addColumn("kt_login_rememberme", "CHECKBOX_1_0_TYPE", "POST", "kt_login_rememberme", "0");<br />// End of login transaction instance<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rscustom = $tNGs->getRecordset("custom");<br />$row_rscustom = mysql_fetch_assoc($rscustom);<br />$totalRows_rscustom = mysql_num_rows($rscustom);<br /><br />?>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <script src="includes/common/js/base.js" type="text/javascript"></script>
    <br />
    <script src="includes/common/js/utility.js" type="text/javascript"></script>
    <br />
    <script src="includes/skins/style.js" type="text/javascript"></script>
    <br /><?php echo $tNGs->displayValidationRules();?>
    <br />
    <br />
    <br />
    <br /><?php<br /> echo $tNGs->getLoginMsg();<br />?>
    <br /><?php<br /> echo $tNGs->getErrorMsg();<br />?>
    <br />
    <form method="post" id="form1" class="KT_tngformerror" action="%3C?php%20echo%20KT_escapeAttribute(KT_getFullUri());%20?%3E">
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <table cellpadding="2" cellspacing="0" class="KT_tngtable">
    <tr>
    <td class="KT_th">
    <label for="kt_login_user">Username:</label>
    </td>
    <td>
    <input type="text" name="kt_login_user" id="kt_login_user" value="<?php echo KT_escapeAttribute($row_rscustom['kt_login_user']); ?>" size="32" />
    <br /> <?php echo $tNGs->displayFieldHint("kt_login_user");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_user"); ?></td>
    </tr>
    <tr>
    <td class="KT_th">
    <label for="kt_login_password">Password:</label>
    </td>
    <td>
    <input type="password" name="kt_login_password" id="kt_login_password" value="" size="32" />
    <br /> <?php echo $tNGs->displayFieldHint("kt_login_password");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_password"); ?></td>
    </tr>
    <tr>
    <td class="KT_th">
    <label for="kt_login_rememberme">Remember me:</label>
    </td>
    <td>
    <input <?php if (!(strcmp(KT_escapeAttribute($row_rscustom['kt_login_rememberme']),"1"))) {echo "checked";} ?> type="checkbox" name="kt_login_rememberme" id="kt_login_rememberme" value="1" />
    <br /> <?php echo $tNGs->displayFieldError("custom", "kt_login_rememberme"); ?></td>
    </tr>
    <tr class="KT_buttons">
    <td colspan="2">
    <input type="submit" name="kt_login1" id="kt_login1" value="Login" />
    <br /></td>
    </tr>
    </table>
    <br />
    <a href="forgot_password.php">Forgot your password?</a>
    <br /></form>
    <br />
    <p>&#160;</p>
    <br />
    <br />

  • Very URGENT: PLS HELP:canno resolve symbol session.setAttrribute

    hi everbody,
    i'm new at this and have got a presentation after 1 day!....pls help
    when i compile the servlet i get :
    cannot resolve symbol
    metod: setAttribute (java.lang.String,java.lang.String)
    location: interface(javax.servlet.http.HttpSession)
    the servlet that gets te error when comiled is:
    * Authenticate.java
    // this places all user variables in session
    //to access use session.getAttribute
    //dispatcher stuff
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    * @author Gudiya
    * @version
    public class Authenticate extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    HttpSession session = request.getSession(true);
    Connection con=null;
    String sessionid;
    String deptcode;
    String desig;
    String add1;
    String add2;
    String contname;
    PrintWriter out = response.getWriter();
    try
    response.setContentType("text/html");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:SACFA","","");
    System.out.println("connection established");
    catch(ClassNotFoundException e){
    System.out.println("database driver not found");
    System.out.println(e.toString());
    catch(Exception e){System.out.println(e.toString());
    // ServletContext context=getServletContext();
    String username=request.getParameter("username");
    String password=request.getParameter("password");
    try{
    PreparedStatement stmt=con.prepareStatement("SELECT * FROM AUTHENTICATION,mb_add where AUTHENTICATION.NAME=? AND AUTHENTICATION.PASSWORD=? AND mb_add.DEPT_NAME=?");
    stmt.setString(1,username);
    stmt.setString(2,password);
    stmt.setString(3,username);
    ResultSet rs=stmt.executeQuery();
    boolean rowfound=false;
    rowfound=rs.next();
    if (rowfound==true)
    sessionid=session.getId();
    System.out.println(sessionid);
    //context.setAttribute("userid",sessionid);
    // session.setAttribute("user",username);
    rs.beforeFirst();
    while (rs.next())
    deptcode=rs.getString("DEPT_CODE");
    desig=rs.getString("DESIGNATION");
    add1=rs.getString("ADDRESS1");
    add2=rs.getString("ADDRESS2");
    contname=rs.getString("NAME");
    session.setAttribute("dept_code",deptcode);
    session.setAttribute("designation",desig);
    session.setAttribute("address1",add1);
    session.setAttribute("address2",add2);
    session.setAttribute("cont_name",contname);
    //context.getRequestDispatcher(request.getParameter("dispatcho")).forward(request,response);
    }          out.println("<html>");
              out.println("<head>");
              out.println("<title>Successful Login Screen</title>");
              out.println("</head>");
              out.println("<body bgcolor='ORANGE'>");
    out.println("<script language='Javascript'>");
    out.println("<!--function send_onclick(mydispatcho) {var dispatcho;if(mydispatcho=='Noc'){ dispatcho='/Noc1';}if(mydispatcho=='Ce'){ dispatcho='/Ce1';} if(mydispatcho=='Bye'){ dispatcho='/Bye1';}}-->");
    out.println("</script>");
    out.println("WELCOME MEMBERS FROM "+ username);
    //print decorative html statements here
              out.println(" SELECT NY ONE ACTION:-");
    out.println("<form Action="+"\"servlet/noc\""+" method =post>");//call for your noc servlet
    //print decorative html statements here
    out.println("<INPUT TYPE=submit VALUE='GENERATE NOC' NAME='NOC' language='javascript'>");
    out.println("</form>");
    //print decorative html statements here
    out.println("<form Action="+"\"servlet/comments\""+" method =post>");//call for your comment servlet
    out.println("<INPUT TYPE=submit VALUE='ENTER/ MODIFY COMMENTS' NAME='COMMENTS' language='javascript' >");
    out.println("</form>");
    //print decorative html statements here
    out.println("<form Action="+"\"servlet/bye\""+" method = post>");
    out.println("<INPUT TYPE=submit VALUE=EXIT NAME=EXIT language='javascript' >"); //place javascript fucction for exiting window
    out.println("</form>");
              out.println("</body>");
              out.println("</html>");
    con.close();
    } catch( SQLException e){ }
    out.close();}
    NOTE: I'M USING JDK1.3 and jsdk2.0
    pls help me....
    Thank u all,
    ashna

    HTTP Status 404 - /mywork/servlet/Authenticate
    hi dheeraj,
    thank u so much the servlet comiled!!!
    now i have a new problem....the Tomcat server cannot find its class file. i have placed the class file in C:\Program Files\Apache Group\Tomcat 4.1\webapps\mywork\WEB-INF\classes.
    the error it shows is as follows:
    type Status report
    message /mywork/servlet/Authenticate
    description The requested resource (/mywork/servlet/Authenticate) is not available.
    Apache Tomcat/4.1.18-LE-jdk14
    PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11

  • To pass new session variable value to stored proc before running a report.

    Hi,
    Below is summary of the report requirement -
    Database level design
    1. Created a view and a global temporary table (GTT)
    2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
    Repository level design
    1. Created a business model containing the view and the GTT (mentioned above)
    2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
    Query for these variables :
    from_dt = select from_date from <table>
    to_dt = select add_months(from_date,12) from <table>
    Presentation level design
    1. Using a text box, i display the default/initialized values of these variables like this -
    Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
    Dates get displayed in YYYY-MM-DD 00:00:00 format
    The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
    2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
    i select Calender Controls for both; setting Default To = Report Defaults.
    The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
    3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
    SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
    Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
    If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
    If the user does not specify different date range, then the default/initialized dates must be considered.
    I also display the default and new date values in the report title.
    Back to Repository level design
    To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
    DECLARE
    v_from_dt date;
    v_to_dt date;
    BEGIN
    v_from_dt := VALUEOF(From_Dt);
    v_to_dt := VALUEOF(To_Dt);
    package_name1.package_body(v_from_dt,v_to_dt);
    END;
    Now when i try to run the report i get the following error :
    [nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
    Need help on this.
    Is it possible to "write back" a new value to a session variable ?
    Any other alternatives.
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 24, 2011 10:08 PM

    Sandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
    *10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
    It's not a BI error. This error are generated by Oracle DB. If I write next:
    SELECT MyPLSQLFunction(p1,p2) FROM DUAL
    I get the same error.
    Oracle doesn't allow DML operations in SELECT.
    Did you relalize this feature yourself? Where did I mistake?

  • Pls help me.. unable to get past mac login sreen!!

    Hello people, This is my first post and after much searching i am praying someone can help..!
    I have a mac g5 dual, and i am having a really annoying problem, my mac keyboard is not working, sometimes some of the keys work but others dont, or none of the keys work, or when i press a button it types a different letter or types 2 or 3 at once!!
    Therefore i can not get past the login screen as the keys needed for thre password do not work!! not even when i try to log into admin!!
    I have purchased a new keyboard today, (wireless apple) but i can not get that to work as i need to pair it to the mac before it will work but i cant pair without getting past the login screen!!!
    typical that this should happen on my only couple of days off too!!
    pls HELP ME
    thanks in advance..

    Yeah, I tried every port available.
    Is there anyway at all i can get into the system settings with a shortcut on startup?
    Then again Im still not sure that the keys will work to use a shortcut.
    Its odd because i managed (just) to login earlier in the day, but the keyboard just seemed to get steadily worse until none of the keys worked!!
    Cheers Dale
    any other ideas??

  • Using Session Variables for User Login - sometimes they don't persist... what am I doing wrong?

    Hi all,
    I'm running a site that requires user login.  I approached the building of this site as almost a complete newb to CF (and dynamic coding in general), and it's been a great learing experience (with lots of help from you guys).
    However, I guess I never learned the correct way to handle a user login.  It seemed to me that I could just test the user-entered credentials against those stored in a database, then set a session variable containg that user's record number.  Then, not only would I have an easy way of knowing who this user was and therefore what info to serve him, but I could test for the existence of a valid login on every page in the protected folder, by adding this code to my application.cfc in that folder:
    <cfset This.Sessionmanagement=true>
    <cfset This.Sessiontimeout="#createtimespan(0,8,0,0)#">
       <cfif NOT isDefined ("session.username") or NOT isDefined ("session.password") or NOT isDefined ("session.storeID")>
         <cflocation url="../index.cfm" addtoken="no">
       </cfif>
    ...and it goes on to run a query and verify that the session.username and session.password match for the store defined by session.storeID.  If not, all session variables are cleared and it bounces you back to the login page.  When the user clicks Logout, all I do is delete all the session variables.
    This seemed to work great for like a year, but lately I've been getting reports that the login doesn't seem to persist for longer than approx. 20 minutes of inactivity.  You can see I specified session variables to remain active for 8 hours (I know that seems like a drastically long login, but it's what's necessary for this application).  I've only gotten this report from a few people, and I myself can't seem to duplicate it... I've tested an inactive login for 45 minutes now and it held.
    SO:  any reason you can think of why session variables would be spontaneously clearing for some people?  Would having your router reset its IP address invalidate the session or something?  Also, the problem seemed to begin appearing after my host upgraded all their servers to CF9... could there be any relation?
    And on a more general note... did I go about this completely the wrong way to begin with?  If so, what's the standard way to manage a login?
    Lots of questions, I know... thanks very much for any answers or suggestions!
    Joe

    Ian,
    Thanks very much - very helpful information.
    Sounds like passing the tokens in every request is probably the way to go for this.  I don't think it's likely that any users will be sharing links, unless they actually intend for the recipient to see their info anyway.
    Is that all I would have to do, is add the tokens to every path?  Would that guarantee that all the session variables would remain valid until timeout or being cleared?
    Again, thanks, you've been really helpful.
    Joe
    On Jun 23, 2010 4:37 PM, Ian Skinner &lt;[email protected]&gt; wrote:
    Unfortunately this is the nature of HTTP web applications.  There is NO state maintained from HTTP request to request.  This is by design in the HTTP protocol specifications.
    ColdFusion provides two methods to circumvent this limitation.  Each method has limitations and caveats.  They both rely on the passing of tokens between the client and the server with every request.  These tokens can be passed as cookies OR URL (GET) variables.  You are using the cookie method, which is the simpler and most common. You may be experiencing the limitation of this method.  If something happens to the cookies the session can be lost.
    You could pass the (CFID &amp; CFTOKEN) OR JESSIONID tokens through the URL query string with every request.  This requires one to add these values to every link, form action, cflocation or other request path in our application.  ColdFusion provides the session.urltoken variable to make this easier to do.  The tokens will be visible to the user.  Also if the links with an individual token is share with other users, via e-mail, chat, social networks, etc and one of these users utilize the link during the life of a session (8 hours apparently in your case).  Then that user will access the session of the original user.
    Cookie session management is by far the most common choice by CF developers.  If these methods do not meet your needs you would need to go beyond the HTTP limitations of web applications.  One might be able to accomplish this with a Flex|Air|Flash applications that can be configured to use a continuous connection to the server.  Thus not suffer the stateless nature of the normal HTTP request-response cycle.
    I do not know if a router resetting would cause cookies to be discarded or otherwise invalidated.  But I would not think it is beyond the relm of possibilities.

  • How to access a session variable just before rendering a JSF page???

    Dear Sirs...
    i am using jdeveloper 10.1.3.2 with JSF and ADF faces. i want to access a session variable and perform some processing just before rendering a page. how can i achieve this????
    i am a little new to jsf, so i feel a little lost
    thanks for any help in advance, and best regards

    <p>
    Hi,
    </p>
    <p>
    See example 60 &quot;<strong>Triggering OnPageLoad-Style Code in a JSF Backing Bean Using ADF PagePhaseListener or PageController</strong>&quot; on Steve&#39;s Muench blog.
    </p>
    <p>
    Kuba 
    </p>

  • Add additional session variable on login?

    Hi,
    at first, sorry for my bad englisch. Maybe anyone here can speak german.
    Is there any way to save an additonal session variable on login without it is required to store this variable in a table column.
    A short description:
    I have a member table, that contains the login information (id, password, level) and further information about the member. A second table contains different sportevents.
    Now i would create a login form, which has 3 input fields, one for the member id, one for the password and one select field, who the member can choose the sportevent. For further work, i need the member id, the member level and the sportevent id as a session variable. There is no problem, with the member id and the level id, this both variables i can get with the ADDT login wizard, but how can i safe the event id during the login as session variable?
    Can anybody help me?
    Thanks in advance.
    Rico

    Hi Rico,
    Maybe anyone here can speak german
    na komm, dein Englisch ist ziemlich gut, und ich möchte deine Frage lieber in Englisch beantworten, damit andere ADDT-User auch was davon haben :-)
    There is no problem, with the member id and the level id, this both variables i can get with the ADDT login wizard, but how can i safe the event id during the login as session variable?
    What I´m saying now, is somewhat experimental, because I didn´t try that myself so far -- but I think this should work:
    a) add another numeric (int) column to your ADDT login table that´s going to hold the selected value from your "events" menu -- let´s call this column "current_event_id"
    b) on the login page: create a recordset which retrieves the "event_id " and "event_name" values from your "sportevents" table -- guess that´s what you already did for populating the "events" menu you mentioned
    c) switch the login page to CODE. When scrolling down, you´ll see these 2 lines below the // Add columns comment:
    $loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");
    $loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");
    below that, add another line like this:
    $loginTransaction->addColumn("current_event_id", "NUMERIC_TYPE", "POST", "events");
    In order to convert the submitted "events" menu - value to a session variable, you should add the new column "current_event_id" to ADDT´s list of default session variables
    (Control Panel)
    Does that work ?
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

Maybe you are looking for