Can a session variable be an array?

I have a dynamic list which may have multiple values
selected. I can capture the resulting array in a $_POST variable.
Using the Insert Record behavior, I cannot cause the $_POST
variables to be sent to the redirect page unless I use session
variables. Can a session variable be defined as an array? If so,
how do I declare it as an array and how do I move the form variable
array to a session variable array? If it can't be an array, how do
I define the target variables for 0 to x items from a form variable
array?

I can't answer specifically for PHP but in the other
languages as session
variable is basically a holding place for a value. As a comma
is a valid
character then if you have a comma delimited list (which is
what a form give
you if multiple items are selected) then you simple assign it
to the session
variable and it will be stored as such.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Rankin" <[email protected]> wrote in
message
news:ef9suk$iqe$[email protected]..
>I have a dynamic list which may have multiple values
selected. I can
>capture
> the resulting array in a $_POST variable. Using the
Insert Record
> behavior, I
> cannot cause the $_POST variables to be sent to the
redirect page unless I
> use
> session variables. Can a session variable be defined as
an array? If so,
> how
> do I declare it as an array and how do I move the form
variable array to a
> session variable array? If it can't be an array, how do
I define the
> target
> variables for 0 to x items from a form variable array?
>

Similar Messages

  • 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

  • Session variable in 'rendered'  tag

    Hello,
    I would like to use a session variable to control whether a component is rendered or not.
    My idea looks like this:
    <h:outputText   value=" #{p.p.ql}"    rendered="#{p.p.ql ==  ' <%= session variable here %> '     }" />the synthax ' <%= session variable here %> ' is not correct and does not work.
    Can a session variable be used this way ? What is the correct way to write this ?
    Thank you very much.
    ed
    Message was edited by: ediestel
    ediestel
    Message was edited by:
    ediestel

    in jsf you can set whether a tag is rendered or not, so it is not a renderd 'tag' but rather an 'attribute' to a tag.

  • Session Variable in Physical Layer

    Hi All,
    I am trying to use session variable in Physical layer i mean in select statement like select region,revenue,year from ABC where siteid ='VALUEOF(NQ_SESSION."siteid")' but it throws a warning saying that
    WARNINGS:
    GLOBAL:
    The repository variable, NQ_SESSION."siteid", has no value definition.
    even though I gave value is zero for not exisiting site in init block but it is still throws same warning.
    is there anything i am doing wrong.Please can you give ur valuable suggestions .
    Thanks for ur replies!!!!!!!!1

    Thanks for replying!!!!!!!
    I checked it.There are no values in it even though i forced some dummy values(i.e it's everthing plain).I dont whether we can pass session variables values in Physical Layer or they can be only used in BMM Layer.
    This is what i did
    select 'siteid',site_id from xyz as a where upper(a.loginname)=upper(:user) union select 'siteid',0 from dual and then pass the values in physical layer
    select e,r,t,,u,i from ABC where siteid ='VALUEOF(NQ_SESSION.siteid){Note:Its just example don't think about column names or tables names}
    Please correct if i am doing anything wrong.
    Thanks

  • Populate session variable by cfselect

    how can i assign a session variable as soon as a cfselect option is selected...

    You can't
    Session variables are in memory on the server.
    Your select control is in memory on the client.,
    These two memory locations can be thousands of miles apart and have no idea what is going on in the other location.
    The only way to have the results of the select control on the client put into session memory on the server is to send the data from the client to the server.
    You can do that by submitting the form which triggers the browser to send a request to the server.
    You can do that by using a JavaScript function triggered on an event on the select to build a request and send it to the sever with the XMLHttpRequest object.  Normaly this is refered to by the buzzword "AJAX".

  • Can we use session variables in BI publisher's Data Model SQL Query?

    Hi Experts,
    We need to implement Data level security in BI Publisher 11g.
    In OBIEE we do so by using session variables, so just wanted to ask if we can use the same session variables in BI Publisher as well
    ie can we include the where clause in the Data Models SQL Query like
    Where ORG_ID = @{biServer.variables['NQ_SESSION.INV_ORG']}
    Let me know your views on this.
    PS: We are implementing EBS r12 security in BI Publisher.
    Thanks

    Read this -> OBIEE 11g: Error: "[nQSError: 23006] The session variable, NQ_SESSION.LAN_INT, has no value definition." when Creating a SQL Query using the session variable NQ_SESSION.LAN_INT in BI Publisher [ID 1511676.1]
    Follow the ER - BUG:13607750 - NEED TO BE ABLE TO SET A SESSION VARIABLE IN OBIEE AND USE IT IN BI PUBLISHER
    HTH,
    SVS

  • How can I use a variable as an array's name?

    Ok I have several arrays in my code (lets call them "array1", "array2" etc) and I want to load them based on the users input. So if the user enters array1, I want the first array to be loaded, and the same with the other arrays.
    I tried saving the user's input on a string variable called ARRAY_NAME, so that each time the user enters a different array name, the corresponding array is loaded. Something like this:
      ARRAY_NAME[c1][c2]; but I get this error:
    array required, but java.lang.String found
              ARRAY_NAME[c1][c2];
    ___________^
    Can you please tell me what is the correct way of doing it?
    Thanx!

    The short answer is you can't. An object name can't be
    variable and must be known at compile time. But you
    could associate the user input name with a particular
    array, for example, using a HashMap with the user name
    as the key to an array. However, you'd need to use a
    container class (Vector, ArrayList, etc.) rather than
    a raw array, because containers only take class
    instances as elements.Maps can't deal with primitives, that is true. However, arrays are full scale objects, so they can be put into maps.
    Also, my code had a bug in it. Try this:
    int userIndex = getUserIndex();
    String userInput = getUserInput();
    Field array = getClass().getDeclaredField(userInput);
    Object item = Array.get(array.get(this), userIndex);

  • 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

  • How can we use Session Variable in Answers or Analysis?

    How can we use Session Variable in Answers or Analysis?

    Again, duplicate cross-posting!
    See rukbat 's post here: Re: BI Apps 7.9.6.3(Agent Issue)

  • 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.

  • Can you pass a session variable in a CFC bind?

    I have a page (dsp_compReqSCM.cfm) that (via a session variable) displays an application value.  From this page (via a CFFORM) I would like to have that session variable passed along to a cfc(getDistinct.cfc).  I can't quite get the syntax correct and am hoping to get some assistance.  When I code #session.this_appl# in dsp_ReqComps.cfm, I get an error stating Element not found PTS (which is the value of session.this_appl) and that the bind cannot occur.  If I pass session.this_appl (NO ##) in dsp_ReqComps.cfm, I get an error stating Element not found session and that the bind cannot occur.   If I pass 'session.this_appl' or "session.this_appl" in dsp_ReqComps.cfm, I get an error stating Element not found 'session (or "session) and that the bind cannot occur.
    dsp_compReqSCM.cfm calls dsp_ReqComps.cfm via cfform
    <!---dsp_ReqComps.cfm--->
    <cfwindow initshow="true" center="true" width="430" height="340">
    <cfform>
         <cfgrid name="componentsGrid"
                 format="html"
                 pagesize=10
                 striperows="yes"
                 bind="cfc:distinctComponents.getDistinct({cfgridpage},{cfgridpagesize},{cfgridsortcolumn} ,{cfgridsortdirection},#session.this_appl#})"
                 selectmode="row" >
             <cfgridcolumn name="Component_type" header="Component Type" width="400">
         </cfgrid>
    </cfform>
    </cfwindow>
    <!---getDistinct.cfc--->
    <cfcomponent>
        <cffunction name="getDistinct" access="remote" returntype="struct">
            <cfargument name="page">
            <cfargument name="pageSize">
            <cfargument name="gridsortcolumn">
            <cfargument name="gridsortdir">
            <cfargument name="appl_in"  type="string" required="true">
      <cfset var Qcomponents = ''>
        <cfif gridsortcolumn EQ "">
       <cfset gridsortcolumn = "ASC">
      </cfif>
            <cfif gridsortdir EQ "">
       <cfset gridsortdir = "ASC">
      </cfif>
       <cfquery name="Qcomponents" datasource="Tax">
          select DISTINCT(component_type) from ctl_components 
         where app_abbrev = #appl_in#
       </cfquery>
        <cfreturn QueryConvertForGrid(Qcomponents, page, pageSize)>
      </cffunction>
    </cfcomponent>
    Any advice you can give is greatly appreciated!
    Libby H.

    @Libby H
    There are 2 things.
    1) The name of the component the grid binds to(distinctComponents) is different from the name of the CFC(getDistinct).
    2) Session variables are also available to components. There is therefore no need to pass them explicitly to a function. In any case, it is always advisable to test for the existence of a session variable before using it.
    Your code would then be something like
    <cfform>
         <cfgrid name="componentsGrid"
                 format="html"
                 pagesize=10
                 striperows="yes"
                 bind="cfc:distinctComponents.getDistinct({cfgridpage},{cfgridpagesize },{cfgridsortcolumn},{cfgridsortdirection})"
                 selectmode="row" >
             <cfgridcolumn name="Component_type" header="Component Type" width="400">
         </cfgrid>
    </cfform>
    </cfwindow>
    <!---distinctComponents.cfc--->
    <cfcomponent>
        <cffunction name="getDistinct" access="remote" returntype="struct">
            <cfargument name="page">
            <cfargument name="pageSize">
            <cfargument name="gridsortcolumn">
            <cfargument name="gridsortdir">
      <cfset var Qcomponents = ''>
        <cfif gridsortcolumn EQ "">
       <cfset gridsortcolumn = "ASC">
      </cfif>
            <cfif gridsortdir EQ "">
       <cfset gridsortdir = "ASC">
      </cfif>
    <cfparam name="session.this_appl" default="your_default_value">
       <cfquery name="Qcomponents" datasource="Tax">
          select DISTINCT(component_type) from ctl_components 
         where app_abbrev = #session.this_appl#
       </cfquery>
        <cfreturn QueryConvertForGrid(Qcomponents, page, pageSize)>
      </cffunction>
    </cfcomponent>

  • Can i use session variable VALUEOF(NQ_SESSION.USER) in write back report?

    Hi All,
    I have created a write back report and successfully inserted records into a table.
    Now i want to capture the user who has inserted in to the table.
    Till now i have given edit option to the users on USERNAME column.
    But now i want to capture the user automatically.
    when i user VALUEOF(NQ_SESSION.USER), i can capture the Logged in user in USERNAME col and the moment i execute the report it is throwing an error.
    What i observed is....
    In the advanced tab USERNAME col is changed to VALUEOF(NQ_SESSION.USER).
    is there any workaround for this?
    Thanks

    >>I have a session variable assigned to the ID#(auto
    number in access db) of messages posted.
    I not sure if I follow your in the description. I would
    assign the Record ID to the session variable.
    Place the Record id in the repeat region.
    Then you could assign that record id to a session variable
    when the button is click, capture the button click event. Then
    redirect to the EMPLOYEEMessageDELETE1.asp page, which will read in
    the session variable (record id) to be deleted.
    David Pearson

  • Can XSQL create multiple session variables using only one database call?

    Right now if I want to set session variables for username and accesslevel, I code out like this:
    <xsql:set-session-param name="name" bind-params="username password">
    SELECT DISTINCT USERNAME
    FROM LKUP_USER
    WHERE USERNAME = ? AND PASSWORD = ? AND ACCESSLEVEL = 0
    </xsql:set-session-param>
    <xsql:set-session-param name="authlvl" bind-params="username password">
    SELECT DISTINCT ACCESSLEVEL
    FROM LKUP_USER
    WHERE USERNAME = ? AND PASSWORD = ? AND ACCESSLEVEL = 0
    </xsql:set-session-param>Is there any way to do it so that I don't have to do multiple queries to the database to set session variables? i.e., something like this:
    <xsql:set-multiple-session-param name="user authlvl" bind-params="username password">
    SELECT DISTINCT USERNAME,
    ACCESSLEVEL
    FROM LKUP_USER
    WHERE USERNAME = ? AND PASSWORD = ? AND ACCESSLEVEL = 0
    </xsql:set-multiple-session-param>Sort of like how bind-params works. Setting bind-params="username password" makes the first ? akin to username and the next ? akin to password.
    Is this functionality already in existence?
    Thanks!
    Malik Graves-Pryor

    Not currently possible to collapse into one request without doing it in a custom action handler.
    A custom action handler can:
    [list=1]
    [*]Get the current JDBC connection from the XSQLPageRequest
    [*]Get the SQL statement to perform using the function getActionElementContent
    [*]Handle any bind parameters specified an a bind-params attribute on the action element by calling handleBindVariables()
    [*]Execute and fetch the row from the query
    [*]Check to see that the return value of getPageRequest().getRequestType() equals the value "Servlet"
    [*]Cast the page request to an XSQLServletPageRequest and call getHttpServletRequest()
    [*]Call getSession() on the request
    [*]Set the session variables you want to
    [*]Close the JDBC statement
    [list]
    will consider a built-in enhancement for a future XSQL release.

  • Can i store the Result set values as a Session variable

    hai,
    I want the result set values of a query to be used many times and I want the same resultset between different page calls.
    I want all those records fetched from the database to be available in the next page with out refetching from the database.
    can any one help me out. its very urgent.....
    Thanks and regards,
    Ravikiran
    mail to me at : [email protected]

    "can i store the Result set values as a Session variable "
    Practically Yes u can
    but u want be able to accesses it in other pages
    u can try it and see
    the other thing u can do is store the values from the resultset in a object say vector and put vector in seesion and u can use this any where
    for e.g
    Vector v=new Vector();
    While(rs.next())
    v.addElement(rs.getString(1));
    v.addElement(rs.getString(2));
    session.putValue("myVector",v);
    now where u want to get it do this
    Vector myvec=(Vector)session.getValue("myVector");
    do do futher

  • Can someone tell me why this is not setting the session variable?

    first page
    <?php
    // script1.php
    session_start();
    echo "<form action=\"script2.php\" method=\"post\"
    name=\"name1\">";
    echo "Your name: <input name=\"name\" type=\"text\"
    size=\"20\" value=\"\">  ";
    echo "<input name=\"submit\" type=\"submit\"
    value=\"Submit\">";
    echo "</form>";
    ?>
    second page
    <?php
    // script2.php
    session_start();
    echo('Hello, ' . $_SESSION['name1']);
    ?>

    jlw12689 wrote:
    > second page
    >
    > <?php
    > // script2.php
    > session_start();
    > echo('Hello, ' . $_SESSION['name1']);
    > ?>
    You need to set the session variable first.
    <?php
    session_start();
    if (isset($_POST['name1'])) $_SESSION['name1'] =
    $_POST['name1'];
    echo 'Hello, ' . $_SESSION['name1'];
    ?>
    By the way, using echo to create your form on page one is a
    complete
    waste of time. Just use an ordinary HTML form - a lot less
    typing, and a
    lot more efficient.
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for

  • How to convert rows of internal table to columns of another internal table?

    Hi, Experts, test_data.xls: one two three four five one two three four one two three one two one CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'   EXPORTING     FILENAME                      = 'c:/test_data.xls'     I_BEGIN_COL                   = '1'  

  • N96 won't detect my captured pictures

    hi i have nokia n96 and 2-days ago i got corrupted (mass) memory error so i restarted the phone and it was ok. But now Photos application won't detect my Captured pictures. The directory tree of Images was intact after corruption (probably) so nothin

  • In BADI - CRM_COPY_BADI, i need to modify Partner No

    Hi Experts, I have a requirement like - in Copy Control Quote to Quote in CRM, i need to Copy all Custom fields and modify Partner No based on some condition. For that I have implemented BADI - CRM_COPY_BADI and now for Custom field copy to the Targe

  • Why is GarageBand taking forever to download?

    Hey so I bought a new macbook pro (13 inch) online off of ebay. It is a 2012 edition(md101/lla). It didn't come with GarageBand all that so I had to go to the App Store and click on Purchases and install it from there. Now here's the problem. I opene

  • Oracle in Linux

    hi friends... i would like to know suppose am running my oracle database in linux platform, i send a query to a database using lower case statement while the column names of the tables are in upper case... will it throw an error ? I am asking this be