setting sessions on nav links

Discussion in 'PHP' started by dooie07, May 18, 2007.

  1. #1
    Iv'e a quick php question, im trying to get a table to display to the current page via a click on a nav link...

    I am creating a session called ['add_new_club']
    $_SESSION['add_new_club'] = " code makes a table";

    Then on my nav link
    <a href="<?php start_session($_SESSION['add_new_club']);?>">add new club</a>

    Then running an if statment to check if the session isset
    if (isset($_SESSION['add_new_club']))
    {
    echo $_SESSION['add_new_club'];
    }

    Do you see what im trying to do? Do i need to POST the link and reload the page to catch the session?

    Any Ideas?

    Doo
     
    dooie07, May 18, 2007 IP
  2. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Where will the navlink lead?
     
    MMJ, May 19, 2007 IP
  3. dooie07

    dooie07 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    no where, just reload the page, and display the table
     
    dooie07, May 19, 2007 IP
  4. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #4
    I didn't get you exactly, but I think you have a table code stored in a session variable. Now you want to display this table when a link is clicked.
    If that is right, all you have to do is echo the table code like normal html but use a style=" visibility: hidden;" to hide the table. When the link is clicked, use javascript to change the "value" of visibility "attribute" to visible.
    regards
     
    JEET, May 19, 2007 IP
  5. dooie07

    dooie07 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thats great, thx.

    But JavaScript is not my strong point, do you have a snippet og code for that?

    Regards

    Doo
     
    dooie07, May 19, 2007 IP
  6. 5thround

    5thround Active Member

    Messages:
    126
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #6
    Try snooping around on Google, I'm sure you can find a script to do something you are similar to doing and then just modify it to fit your needs.
     
    5thround, May 19, 2007 IP