Adding session variables from a recordset

I'm trying to create a session variable from data from a
recordset, can anyone help?
this is what I want the session variable to be from the
recordset:
<?php echo $row_rsStrata_plan['plan_str']; ?>
but I'm not sure where to go from here: $_SESSION[test] =?
Thanks,

Make sure you have <?php session_start(); ?> at the top
of your page
Then
$_SESSION['test'] = $row_rsStrata_plan['plan_str'];
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete
Login system.

Similar Messages

  • Problem accessing session variable from jsp

    Hi!
    I get an error retrieving a session variable from inside a JSP declaration scriptlet....
    Something like this code in a JSP page:
    <%!
    public void funtion1() {
    String parameter1 = session.getAttribute("parameter1");
    %>I have seen that I have available getContextServer() method and from there I could call getAttribute("parameter1") . But the thing is that the attribute I want to retrieve was stored in session by another Jsp page.
    Any solutions are welcome
    Cheers
    Victor

    Appropriately the above is one the reasons also You cannot use JSP implicit objects from the declaration tag. However we can think of a small workaround by passing the reference like the one discussed below
    <%!public void funtion1(HttpSession session) {
    String parameter1 = session.getAttribute("parameter1").toString();
    }%>
    <% funtion1(session);%>Hope that helps :)
    REGARDS,
    RaHuL

  • Passing Session Variable from PHP to Applet

    I'm trying to pass a session variable from a PHP script to a third party applet. The applet needs to accept the variable as a string into a parameter. I think the htnl has to be dynamically created to turn the session variable into a string for the parameter value. Any suggestions ?

    This is really a PHP question. You might get better results on a PHP forum.

  • How to get and set a session variable from backing bean?

    Hi im using Jdev 11.1.1.2.0 and i need to set and get a session variable from backing Bean.
    Any idea?

    the class :
    package arq.resources;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class SesionSigef {
    public FacesContext context;
    public HttpSession session;
    public SesionSigef() {
    super();
    context = FacesContext.getCurrentInstance();
    session = (HttpSession)(context.getExternalContext().getSession(true));
    public Object getVariableSesion(String atributo){
    return session.getAttribute(atributo);
    public void setVariableSesion(String atributo,Object valor){
    session.setAttribute(atributo, valor);
    the example of use :
    SesionSigef se = new SesionSigef();
    DatosRec da = new DatosRec();
    da.setDocumentoCip("Aprobar");
    se.setVariableSesion("DatosRec", da);
    thanks
    Joaquin

  • Adding session variable causes Dreamweaver to not recognize recordset

    I have a recordset that I have written in advanced mode, the test checks out fine and dreamweaver reconizes it in "server behaviors" and the code is colorized in "code view". Testing the page in a browser works fine.
    Adding a variable for session username, still checks out with MySQL and saves to the page but is no longer recognized in the "server behaviors" and in "code view" it is no longer colorized. All server behaviors that use a recodset as in repeat regions break and cannot find the recordset. Testing in a browser quickly displays a blank page in firefox and a 500 error in IE.
    This is with a bogus variable, which loads fine.
    mysql_select_db($database_ess, $ess);
    $query_client_bdays = "SELECT clients.clientname, clients.birthmonth, clients.birthday FROM clients WHERE clients.username=username AND CONCAT(YEAR(CURDATE()),'-',birthmonth,'-',birthday) BETWEEN DATE_ADD(CURDATE(), interval 30 day) AND DATE_ADD(CURDATE(), interval 60 day)";
    $client_bdays = mysql_query($query_client_bdays, $ess) or die(mysql_error());
    $row_client_bdays = mysql_fetch_assoc($client_bdays);
    $totalRows_client_bdays = mysql_num_rows($client_bdays);
    Here is with the session
    $varU_client_bdays = "-1";
    if (isset(<?php echo $_SESSION['username']; ?>
      $varU_client_bdays =<?php echo $_SESSION['username']; ?>;
    mysql_select_db($database_ess, $ess);
    $query_client_bdays = sprintf("SELECT clientname,  birthmonth, birthday FROM clients WHERE clients.username=%s AND CONCAT(YEAR(CURDATE()),'-',birthmonth,'-',birthday) BETWEEN DATE_ADD(CURDATE(), interval 30 day) AND DATE_ADD(CURDATE(), interval 60 day)", GetSQLValueString($varU_client_bdays, "text"));
    $client_bdays = mysql_query($query_client_bdays, $ess) or die(mysql_error());
    $row_client_bdays = mysql_fetch_assoc($client_bdays);
    $totalRows_client_bdays = mysql_num_rows($client_bdays);
    I have also included a screen shot of the mess in code view.
    Thanks for any help in advance!

    Found the answer, changing from  <?php echo $_SESSION['username']; ?>  to   $_SESSION['username'];  resolved the issue.

  • Can I set a Session Variable from a Dashboard Prompt, using values that are

    Hi All
    Trying to set a Session Variable to an integer value, by letting users select a text value from the drop-down list on a Dashboard Prompt. The goal is to set the input parameter to the IndexCol function, but to provide the end users with a text description of what they are setting.
    Select Value Set Variable Value
    My 0
    My Team 1
    My Companies 2
    My Teams Companies 3
    Any suggestions on how to accomplish this? Certainly we could populate the drop-down from a data source, however I don't see how to populate a variable with something other than the values on the screen.
    The IndexCol function is referenced in a Filter in Answers, and I'm thinking to populate a Session variable using the (Presentation) variable value set from the prompt. But how to do this? I see a reference to a function NQSSetSessionValue(), but cannot find documentation on how it works.
    Any clue will be greatly appreciated.
    Thanks

    Hi kishore..
    Looks like the link u have sent uses advanced SQL tab to set session variables. I want to know if I can use "set variable NQ_SESSION.myvar= @something" in the "SQL results" -while creating a dashboard prompt-.
    Purpose: I want the session variable to be set based on whatever report that im currently in.
    And i dont want to use presentation variables because im using a reset button in my page.
    My reset script resets presentation variables and NOT session variables.
    Thanks in advance
    Loy

  • Passing values to session variables from another application

    Hi,
    From an external application we are passing username and password for accessing the OBIEE Dashboard.In the url call we are passing NQUser and NQPassword. This is working fine.
    To setup data level security we need to pass region id list also as request object. Then we can filter the tables by the value in the region id list for that user. If we use external table to pass the home_id list then the application is working fine by setting up row-wise init block. But we need request object from an external application to send the list. How can we accept the list from OBIEE RPD?
    In the documentation it mentions about session variables - non system. But it requires an init block. How can we create a variable that accepts the values when user logins just like NQUser and NQPassword.
    Please suggest.
    Thanks.

    Try this ...
    http://oraclebizint.wordpress.com/2007/07/30/customizing-obi-ee-%E2%80%93-go-url-parameters/
    In this blog entry you'll find at the bottom ...
    Hello, Can you please explain how to pass parameter values in the url. For example, I want to run an answers query and pass into the url something like this: &Region=West
    Venkatakrishnan J Says:
    August 22, 2007 at 7:36 am
    Yes, this absolutely possible. You can get the details from the Web Services guide since it has all the necessary examples and more explanation. Thats why i did not include it in the blog. You can get it from page 213 of the Docs http://download.oracle.com/docs/cd/B40078_02/doc/bi.1013/b31766.pdf

  • "Go Back" whilst adding SESSION VARIABLE?

    Is it possible to add a SESSION VARIABLE at the same time as one operates a "Go Back" link?
    My site covers information for three towns. The names of the towns are the possible SESSION VARIABLES. In the absense of a SESSION VARIABLE I plan to divert to a page where the user selects a town form the list of three links. I am trying to make this link add the selected town-name as a SESSION VARIABLE and also operate the "Go Back" link so that the target page now receives a SESSION VARIABLE.
    I tend to use php and in this case I am making use of a Go Back javascript, but cannot work out quite how to make it work, or if it is possible.
    I'm using DWmx2004.

    Thanks for the ideas.
    DWFAQ.info wrote:
    You can use javascript to save info on a cookie and use go back button. Then you can use the info from the cookie to write to session variable on the page you went back to. Depending on what you're doing there may be security issues involved using this method.
    That sounds interesting. Security is not an issue here, but I've not used cookies before. Could you either explain how that would be done, or point me to an explanation (and example) somewhere, please?

  • Trying to pass Hidden/Session variables from 1 JSP to 3rd JSP

    Hellol JSP Gurus !!
    This is a question on how a hidden or a value of a session variable can be passed from 1 JSP to a 3rd JSP, with the 2nd JSP as a Processing page.
    For eg., here's the scenario
    I have a Login page which has the hidden variables. Once the user enters the Login information, the info is validated in a LoginP.jsp (say, its a Processing page for the Login user/passwd info), which does a sendRedirect to a 3rd (Final) JSP which displays the values of the hidden/session variables of the 1st JSP.
    In my case, for some reason, I am not able to see the value for the hidden or the session variables in the 3rd JSP - they are null values.
    I am attaching some Duke dollars to who ever gives me the right solution.
    Thanks a lot in advance

    Use strings to set attributes;You can store any serializable object in the session. I doubt this will actually change anything.
    Anything wrong with the above code ?Not that I can see ... A number of other things can explain why you're getting null values out of the session. For example :
    - You are not using the implicit session obj in the 3rd jsp, but creating a new one and thus overwriting the one created previously
    - the session timeout value is unusually low, and by the time you're getting to the 3rd jsp, the session is invalidated and you're getting nulls. Verify your server config, or call session.getMaxInactiveInterval() to check the value. Check also if the session is new ( session.isNew() )
    Somebody already pointed this out : If the client does not support cookies and URL rewriting is not enabled, no session ID is returned to the server on a request, which the server then perceives as a new session.
    - Another (remote?) possibility : your 3rd jsp belongs to another webapp (i.e you're redirecting to another app context).
    If nothing of the above applies, post the jsp code and we'll try to help.

  • Problems accessing session variables from a pop-up

    I am working on a webapp and I when I click on a certain button I need to have a pop-up appear that will either prompt a user to enter log-in info if they haven't already, otherwise the pop-up just needs to display a report. Users can navigate around on the main page and select various reports so multiple pop-ups could possibly be opened. When a user logs in I save the login info in session variables, but for some reason whenever I click to have another pop-up open it always says that my session variables are null. Is there a way to have more global session variables so that multiple windows (the pop-ups) can touch session variables? Would there be a way to pass the login info in session variables back to the main page and then pass those session variables back out to each pop-up that opens? Thanks so much.

    Have you got session cookies enabled?
    The most common way to keep track of the session id is via a session cookie.
    This cookie gets shared by all windows of the same browser session.
    You are opening these pop-up windows with window.open?
    Print out the session id <%= session.getId() %> on each page to see if it is the same.
    Cheers,
    evnafets

  • Can I set session variables from inside my Javascript?

    hi all,
    i want to set a couple of session variable while i am inside my javascript.
    can I do that?
    m_asu

    No. JavaScript runs on the client and the session is on the server. You can use JavaScript to set parameters that get passed back in the request and can then be put in the session.

  • Retrieving a session variable from a php script and putting it in an applet

    I have a chat applet and i'm trying to have a session variable in one my php scripts be setted onto the user area of my chat. Would it start out by doing this?
    <object codetype="application/java"
    code = "ClientApplet.class"
    width = "300"
    height = "400"
    classid = "the name of the session variable">
    </object>

    No.
    Use the parameter tags.

  • Altering session variable from PL/SQL

    Does any one have an idea what's wrong with this code, or any suggestion how to perform similar operation.
    I am trying to set my timezone using
    declare
    local_timezone TIMESTAMP WITH LOCAL TIME ZONE;
    begin
    DBMS_UTITLITY.EXEC_DDL_STATEMENT ('Alter Session Set TIME_ZONE = ' || '''' || 'GMT' || '''');
    local_timezone := systimestamp;
    dbms_output.put_line ('Time is : ' || local_timezone);
    end;
    This seems to work since no error is produced but does not set requested timezone. I still get local time.
    Any suggestion.
    Very Urgent.. Thanks for feedback in advance.

    Hi,
    I am trying to get the parameter from pg1(OAPage) to pg2(web pl/sql page) but i can't do it ...
    The link OAPage is :OA_HTML/OA.jsp?_rc=HR_P_RATE_TOP_SS&_ri=800&OAFunc=HR_NEWHIRE_SS&_ti=713401982&retainAM=Y&addBreadCrumb=N&dialogAction=NEXT&oapc=11...
    here i need to pass _ti, retainAM and other parameters to web pl/sql procedure.
    i can't decalare a procedure staring ti like procedure(ti varchar2) coz while executing i am getting error... if i do with this procedure(ti varchar2) i am unable to get _ti parameter in web pl/sql.
    i can get the value of ti from the table(ICXTransactions,icx_sessions) but this is not the feasible to do.
    what is the expansion of parameter &oapc and &oas...
    Please Help....

  • Reading a session variable from a dynamic action

    I have a select list on a page and a button next to the select list. The button calls a dynamic action which opens a page and sends the value in the select list. The page is not submitted. The DA has a step with a dummy PL/SQL block that submits the select list item. Then the page is called with the select list in the URL.
    The value is not being sent. If I go into edit mode then run the page again then the correct value is sent.
    When I look at session in Administration the select list is in session and set properly but is not sent unless the page is submitted.
    Why if it is in session is it not being passed correctly? What does submitting the page do other than update session?

    Hi,
    could you share the exception trace ?
    Frank

  • Filter recordset with session variable

    This has never happened to me before, but for some reason, my
    recordset that drives a dynamic table won't filter results based on
    a session variable. I know session variables are working because I
    have the session variable echo on the page (dragged-n-dropped my
    session variable from the Bindings panel to my page), and that
    works fine. So why can't I filter my recordset with the same
    session variable??? What's going on?
    PS: I've attached my result page's code to this
    message.

    Gabe the Animator wrote:
    > <?php require_once('Connections/sales.php'); ?>
    > <?php
    > if (!function_exists("GetSQLValueString")) {
    > function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "",
    > $theNotDefinedValue = "")
    > {
    > $theValue = get_magic_quotes_gpc() ?
    stripslashes($theValue) : $theValue;
    >
    > $theValue = function_exists("mysql_real_escape_string")
    > mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    >
    > switch ($theType) {
    > case "text":
    > $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    > break;
    > case "long":
    > case "int":
    > $theValue = ($theValue != "") ? intval($theValue) :
    "NULL";
    > break;
    > case "double":
    > $theValue = ($theValue != "") ? "'" .
    doubleval($theValue) . "'" :
    > "NULL";
    > break;
    > case "date":
    > $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    > break;
    > case "defined":
    > $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    > break;
    > }
    > return $theValue;
    > }
    > }
    >
    > $colname_rsSales = "-1";
    > if (isset($_SESSION['state'])) {
    > $colname_rsSales = $_SESSION['state'];
    > }
    > mysql_select_db($database_sales, $sales);
    > $query_rsSales = sprintf("SELECT * FROM sales WHERE city
    = %s",
    > GetSQLValueString($colname_rsSales, "text"));
    > $rsSales = mysql_query($query_rsSales, $sales) or
    die(mysql_error());
    > $row_rsSales = mysql_fetch_assoc($rsSales);
    > $totalRows_rsSales = mysql_num_rows($rsSales);
    >
    > session_start(); ?>
    The issue is that PHP doesn't "work" with session values
    until the session has started, and that must be done on each page,
    and must be done in the code *above* any reference to a session
    variable. The code you posted has the session_start() after it
    tries to use the session value ito filter the recordset. So move
    this last line of code ( session_start(); ) above $colnam_rsSales =
    "-1". Better yet, use:
    if(!session_id()){
    session_start();
    To prevent some versions of PHP from generating a
    warning/notice if you've called session_start() on the page already
    and you call it again.
    Danilo Celic
    | Extending Knowledge Daily :
    http://CommunityMX.com/
    | Adobe Community Expert

Maybe you are looking for

  • Photo stream no longer working with 5.1?

    I updated to 5.1 and now pictures I take with my iPhone are not showing up in my photostream,either on iPad or apple TV. ??? Any ideas??

  • Music continuity problem with N9

    I have downloaded my music from my computer to my N9 using the "use as mass media" -option which you are given when you attach N9 to a computer. Everything else is perfect and how it should be (with these prices) but there is one thing that bothers m

  • Import source from 1 workspace to a new workspace

    There appears to be something missing when I import source files from 1 project into a new project contained in a new workspace. The source files compile indiv. with no errors in both workspaces. The old workspace compilies fine. However when you try

  • How can I get an ID withnot adding a payment details?

    I am 15 years old so I haven't cradit card and my parents aren't give me theirs.

  • HDR Efex 2 causes CC 2014 to crash

    I have upgraded CS5 to CC2014 and have HDR Efex 2 running as a plug-in - I can open files, create the HDR merge window, do any processing but on saving something causes CC to crash.  I have looked at the Nik site and they recommend changing the GPU s