How to display a DIV or not, based on whether a logging session cookie exists or not?

Hi everyone
I have created a logging system for a simple CMS using Dreamweaver server behaviours.
My problem :
When logged in, I would like to show on my pages a DIV saying something like "You are logged in". If not logged in, I would like a different DIV with this text saying "Please log in"
I have simplified the problem as much as I could. Basically, I would like to show something or to hide it and show another thing based on whether the logging session exists or not. Would someone have a simple answer to this problem?
Much obliged, W

Thanks HJ
Your answer helped me find more info about cookies and session which is what I actually needed.
So I can show a particular item based on whether an admin user is logged in, I proceed as follow.
First I check whethet the session exists. If he has just logged in using Dreamweaver logging system, the session will exist. So put the text above the <head> and preferably at the very top of the page.
<?php
if (!isset($_SESSION)) {
  session_start();
?>
Then in the content portion of the page where I want to display, say a DIV with some content for the administrator I place the following :
<?php
$accessLevels = array('a','b');
$validLevel = $_SESSION['MM_UserGroup'];
if(array_search($validLevel, $accessLevels)>-1){
?>
<div id="amendPage" style="margin-left:0;margin-top:0;height:20px;"><a href="/admin/changePage.php">Changez le contenu de cette page</a></div>
<?php
?>
I am checking here whether the user is logged in based on his or her access level which I have previously set in the database. 'a' being an access level and 'b' an other one which might enable more things. So I can play with this array to show something to someone based on the access level.
If I were to remove 'b' from the array, the div would only be visible when a user with an 'a' access level is logged in and vice versa.
Not sure whether this is a good option, but it works for me

Similar Messages

  • How to display data from a recordset based on data from another recordset

    How to display data from a recordset based on data from
    another recordset.
    What I would like to do is as follows:
    I have a fantasy hockey league website. For each team I have
    a team page (clubhouse) which is generated using PHP/MySQL. The one
    area I would like to clean up is the displaying of the divisional
    standings on the right side. As of right now, I use a URL variable
    (division = id2) to grab the needed data, which works ok. What I
    want to do is clean up the url abit.
    So far the url is
    clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
    I want is clubhouse.php?team=Wings.
    I have a separate table, that has the teams entire
    information (full team name, short team, abbreviation, conference,
    division, etc. so I was thinking if I could somehow do this:
    Recordset Team Info is filtered using URL variable team
    (short team). Based on what team equals, it would then insert this
    variable into the Divisional Standings recordset.
    So example: If I type in clubhouse.php?team=Wings, the Team
    Info recordset would bring up the Pacific division. Then 'Pacific'
    would be inserted into the Divisional Standings recordset to
    display the Pacific Division Standings.
    Basically I want this
    SELECT *
    FROM standings
    WHERE division = <teaminfo.division>
    ORDER BY pts DESC
    Could someone help me, thank you.

    Assuming two tables- teamtable and standings:
    teamtable - which has entire info about the team and has a
    field called
    "div" which has the division name say "pacific" and you want
    to use this
    name to get corresponding details from the other table.
    standings - which has a field called "division" which you
    want to use to
    give the standings
    SELECT * FROM standings AS st, teamtable AS t
    WHERE st.division = t.div
    ORDER BY pts DESC
    Instead of * you could be specific on what fields you want to
    select ..
    something like
    SELECT st.id AS id, st.position AS position, st.teamname AS
    team
    You cannot lose until you give up !!!
    "Leburn98" <[email protected]> wrote in
    message
    news:[email protected]...
    > How to display data from a recordset based on data from
    another recordset.
    >
    > What I would like to do is as follows:
    >
    > I have a fantasy hockey league website. For each team I
    have a team page
    > (clubhouse) which is generated using PHP/MySQL. The one
    area I would like
    > to
    > clean up is the displaying of the divisional standings
    on the right side.
    > As of
    > right now, I use a URL variable (division = id2) to grab
    the needed data,
    > which
    > works ok. What I want to do is clean up the url abit.
    >
    > So far the url is
    clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
    > all
    > I want is clubhouse.php?team=Wings.
    >
    > I have a separate table, that has the teams entire
    information (full team
    > name, short team, abbreviation, conference, division,
    etc. so I was
    > thinking if
    > I could somehow do this:
    >
    > Recordset Team Info is filtered using URL variable team
    (short team).
    > Based on
    > what team equals, it would then insert this variable
    into the Divisional
    > Standings recordset.
    >
    > So example: If I type in clubhouse.php?team=Wings, the
    Team Info recordset
    > would bring up the Pacific division. Then 'Pacific'
    would be inserted into
    > the
    > Divisional Standings recordset to display the Pacific
    Division Standings.
    >
    > Basically I want this
    >
    > SELECT *
    > FROM standings
    > WHERE division = <teaminfo.division>
    > ORDER BY pts DESC
    >
    > Could someone help me, thank you.
    >

  • How to display the Standard Text (SO10) based on condition in adobe forms

    Hi,
    I have created the Standard texts (through SO10 tr.code) of 4 plant addresses. In the Layout of adobe form, i want to display any one plant address based on the plant number (as a input) and the rest 3 standard text need to be hide. i tried in Form clac to hide, but i unable to succeed. could you please help me, in this regard. 
    Thank you.
    Regards,
    Mallikarjuna

    Hi,
    You can add all the 4 text in your context menu and create an condition for text.
    Example: (LS_HEADER is a structure only for example, you need to decide based on your own form interface)
    Text_1000                                Condition -> LS_HEADER-WERKS = 1000
    Text_2000                                Condition -> LS_HEADER-WERKS = 2000
    Text_3000                                Condition -> LS_HEADER-WERKS = 3000
    Text_4000                                Condition -> LS_HEADER-WERKS = 4000
    The text satisfyling your condition will only be printed and you can assign these text to the same block in PDF form.

  • How to display results of a report based on current year

    Hi,
    Please advice me for the following requirement.
    I have a report which is having sales results, which is having year column also. Report has to be displayed based on the current year. Now it is 2013. I should show current year results only i.e 2013.
    In 2014, i should show only 2014 results. How to achieve this at a report level.
    regards
    CK.

    Hi CK,
    You are having Data for 2014 also. If not means, you can use sql query select max(year) from period.
    So it will show the final maximum end of the year(2013) from database.
    You can use dashboard prompts too. in the prompt also you can have specific year or sql query
    http://mkashu.blogspot.com
    Regards,
    VG

  • How to display value of an item based on another item

    Hi,
    In a page I've to display name for the corresponding id displayed in id item.Can I write a query based on id and display name as soon as I enter into that item.if so are there any properties I need to set ?I'm looking for just post_text_item functionality in forms?
    Thanks,
    Mahender

    Hi,
    I've created sample table with id,first_name and last_name to test:
    I've created AJAX script in application process area with name GET_NAME
    declare
    v_name varchar2(150);
    begin
    select first_name||'-'||last_name into v_name from names
    where id = :P53_id;
    htp.prn(v_name);
    exception when others then htp.prn('An error occurred retrieving name'||sqlerrm);
    end;
    CREATED JAVA SCRIPT IN html headers section of the page p53:
    <script type="text/javascript">
    function get_name(){
    var id = document.getElementById('P53_id').value;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value, 'APPLICATION_PROCESS=GET_NAME’,0);
    get.add('P53_id',id);
    var gReturn = get.get();
    document.getElementById('P53_name').value = gReturn;
    </script>
    put the following in HTML Form Element Attributes of p53_id :
    onchange="get_name(this,'P53_id)"
    It's not working ?
    Can anyone help
    Thanks
    Edited by: user518071 on Aug 14, 2009 8:14 AM
    Edited by: user518071 on Aug 14, 2009 11:04 AM
    Edited by: user518071 on Aug 15, 2009 5:02 AM

  • How to display data on separate page based on account

    Hi all,
    I have a parameter on my report and it takes list of account ids. I want to display the data in a separate page for each account. For example: If I enter 100,101 then
    101 data should start on separate page after completion of 100 account data.
    Thanks in advance.

    Hello,
    You can create the SQL query in order to set the account as a group and use the
    property "Maximum Records Per Page" of the repeating frame associated to this group to 1.
    Regards

  • How to check whether a user session is null or not

    Hi
    I am using Jdeveloper 11.1.2.2
    I have a use case of running some Junit test case, this is the problem I have :
    There are some Junit tests which are written for some VO's. While testing insert and update operation in Junit there is two mandatory columns Created by and Updated by to be entered for committing into the database.
    These values are taken from the UserName of the current UserSession .
    So for getting the these values for each user I thought of displaying a JPanel before the test is run, where the user enters the Username and password which is validated and the user is verified.
    First, I need to check whether there is a session present or not. For checking this, I wrote a createUserSession() and did like this inside it :
    if(fixture.getApplicationModule().getSession().getUserData().isEmpty())If so to show the Jpanel and get the user details and verify the user.
    But while running the test itself I found that the session is already present, now I just have to input the values based on who is the user.
    But Junit doesn't run the tests in the order in which the test are written. So I have to call this in all the test cases.
    The Question is :
    How can I check whether the session is already present or not, so that I don't have to ask the user every time while every test is running to enter the Username and Password ?
    Thanks,
    Nigel.
    Edited by: Nigel Thomas on Jul 30, 2012 10:26 AM

    Hi,
    wondering why don't you create test users and then automatically log them in as Jan Vervecken did on the threads I pointed you to. This way your test cases run without user interaction. To test if a session exists for a user, I would put a custom property into user data. If this property exists, the user session is an existing one. However, make sure the information you save into the user data survives passivation as otherwise the information you get out of this is not accurate. See: http://tompeez.wordpress.com/2011/07/08/jdev-always-test-your-app-with-applicationmodule-pooling-turned-off/
    Frank

  • Firefox 3.6.13 does not load AOL mail - it logs in ok but does not load

    I updated Firefox to the latest version and it will not load my AOL eMails.
    I can however log into my AOL account and it shows the Welcome message and number of unread mail and also shows the folders etc. including Spam folder but it does not load the eMail or will not allow me to open any eMails.- Just shows blank.
    BTW I can access my AOL mail Box with Internet Explorer.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • How to display warning message in PL/SQL?

    Hi,
    I would like to know how to display a warning message in PL/SQL?
    Thanks and Regards,
    SC

    PL/SQL is not an interactive programming language, so there is generally no place to print any sort of message, no place to prompt the user for input, etc.
    A SQL*Plus script can use the SQL*Plus client as a very basic way of interacting with users using the PROMPT command to accept input and using DBMS_OUTPUT to print messages to the console (assuming the script does a SET SERVEROUTPUT ON to enable printing the results). Other applications may have similar sorts of scripting possibilities, generally based on a subset of the commands SQL*Plus supports.
    Justin

  • How do I find the digital copy of a movie I just redeemed if it is not listed with my movies?

    How do I find the digital copy of a movie I just redeemed if it is not listed with my movies?

    I just liked them all right now.
    Thanks.  So yours only shows one cover movie poster too then. That is what mine shows.
    When you say this:
    based on whether I've got HD selected or not, e.g. my iPhone shows the SD size, but my iTunes based on whether I've got HD selected or not, e.g. my iPhone shows the SD size, but my iTunes (computer) shows HD.
    Do you mean when you have your phone selected on the summary page as you instructed above vs.... what selected for your itunes/computer showing HD?

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • How to display ICON uskng ABAP Query

    Dear all,
    I want to add a new field to an existing query which generates Selfbill Discrepancy report.I want to add a field in the selection screen to see if the billing Document has been cleared or not. I have added this field.
    After executing the report based on whether the document has been cleared or not i want to display either RED or GREEN colour Icon in the first coloumn of the report output.
    I searched some documents regarding this.It is mentioned that a new local field should be created and we have an option to add ICON there. But i am not able to create the local field.If i give the icon name and also choose the ICON symbol but i get an error "Field not yet defined". Can you please help me in this. or is there any other way to add icon to the output.Could you please ellabiorate on the same.
    Regards,
    Subasree

    Just add a field of type c(4) & assign the value '@08@' for Green, '@0A@' for Red. It will be displayed.
    You can check this sample code.
    DATA it_icon TYPE TABLE OF ty_icon WITH HEADER LINE.
    it_icon-c = '@08@'. APPEND it_icon.
    it_icon-c = '@09@'. APPEND it_icon.
    it_icon-c = '@0A@'. APPEND it_icon.
    LOOP AT it_icon.
      WRITE:/ it_icon-c.
    ENDLOOP.
    Refer to the type pool ICON for icon codes.
    Regards,
    Naga Sai
    Edited by: Naga Sai Swapna on Dec 9, 2009 7:38 AM
    Edited by: Naga Sai Swapna on Dec 9, 2009 7:42 AM

  • How can we automate the Depreciation keys based on production for business

    How can we automate the Depreciation keys based on production for business u2013 this is currently not an optimised process if we expect business to manually change the keyu2019s on a monthly basis.
    The end user updates the table, transaction AO25, manually on month end after the production calculations are completed. The question is, is it possible when the PP is completed, that the system updates the Period Unit table for that period?
    Thanks.
    Regards,
    PS PS

    Hi,
    I am new at this, so I need a explanation on how will this help me, and how do I get about doing this?
    Thanks a lot.
    Regards,
    PS PS

  • How to display another window by using Check box

    Hi Friends,
    I have one doubt in Webdynpro with java. How to display another window by using Check box?
    For Exam My requirement is I am getting BAPI from ECC System. So I have to go given input details in first view and output details in Second View. So in Second View I will taken Table that data will displayed in rows. each and every row first check box is available.
    Here Select Check Box of particular row then click Edit button. That row data will be displayed in one popup window.
    empid, name, sal ,firstname, last Name
    empid, name, sal ,firstname, last Name
    empid, name, sal ,firstname, last Name
    Suppose I have to select check box in First Row Click on EDIT button That row data will be displayed in another popup window here customer will change details depending up requirement click on SAVE Button that update data will saved in ECC System.
    How to display another window by using Check box?
    Regards
    Vijay

    Hi Vijay
    Your question is not clear enough to give an answer. Do you have some difficulties with the code for opening a popup-window? There are many-many examples in the forum how to open/close a popup.
    Or you do not know how to bind the popup opening with clicking a check box? Just put the code in the onSelect event handler of the check box.
    BR, Siarhei
    Edited by: Siarhei Pisarenka on Mar 11, 2010 10:55 AM

  • How to check whether a Record Exists or not in Ztable

    Hi all,
    I have Req like this
    In ZTable i have 2 fields  * Legacy System , Legacy Material No*
    Environment Value is coming in one of the field in Idoc
    The logic is if the Environment Value is UK and a Record Exists on the ZTable for Legacy Sysyetm = Leg1 means i have send Legacy Material No , else  Send 01
    Please suggest me the process for this
    REgards
    Vamsi
    Edited by: Vamsi Krishna on May 19, 2009 5:31 PM

    Hi Michal / Aamir,
    Thanks for your replies.
    The ZTable is at R/3 side only, iam using RFC Lookup for this, but iam bit confuse on how to construct the logic to check whether there is a record Exists or not on Ztable
    Logic shld be If the Environment value is UK and a record exists on the Ztable for Legacy system "ABC" means then send Legacy material number else send 01
    In Table we will have the fields Legacy System   Legacy Material No  & Environment value is coming from Idoc itself( Ex: UK or US)
    Regards

Maybe you are looking for

  • Can I use internet sharing to give internet to my Apple TV through my Macbook and use Airplay on the same computer at the same time?

    So I am using internet sharing from my Macbook to my Apple TV. The router providing internet to my Macbook has an ip address that looks like 192.168.0.x. Since the internet sharing feature assigns an ip address that looks like 192.168.2.x to my Apple

  • Can't get SNMP working

    I've turned on SNMP in Server Admin and the snmpd (daemon) is running as verifed in Activity Monitor. The snmpd.conf file is located at /usr/share/snmp and everything looks as it should. But, I can not access the snmp data from a client. When I use I

  • Hyperlinks in slideshows

    I have a 152 page book I want to insert into my slideshows. Created in InDesign CS6, with hyperlinks to websites and email addresses on each page. Tried to work it in as an interactive  .pdf, but no joy. Used .swf in past, but want it viewable on IOS

  • How to open html/SVG in Illustrator?

    I drew a beautiful SVG for a website, just coded it in html/css/javascript. (It's in there, just scroll around) http://bl.ocks.org/greencracker/raw/6798490/ It needs finishing by hand ... how on earth do I open it in Illustrator? I downloaded it as a

  • Spyware problem

    I got one of those "Your computer is infected with spyware" and inadvertantly clicked on it. Now there is a window permanently open that cannot be closed, saying "Warning, your computer is infected with Spyware". How do I get rid of this window pleas