Results 1 to 3 of 3

Thread: AnyLink Drop Down Menu & append_sid ?

  1. #1
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post AnyLink Drop Down Menu & append_sid ?

    1) Script Title: AnyLink Drop Down Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem:
    Hello,

    First of all thank you for not only providing such usefull scripts but also maintaining them.

    I have a slight problem when I use the drop down menu.
    My site is using the append_sid function in order to parse the session from one page to another, avoiding to loose it this way.
    The problem is that I don't find the way to put it in your code.

    I tried to put it in the JS Array :
    PHP Code:
    <script type="text/javascript">

    /***********************************************
    * AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //Contents for menu 1
    var menu1=new Array()
    menu1[0]='<a href="add_refin.php">Add Refining Recipe</a>'
    menu1[1]='<a href="add_fini.php">Add Finishing Recipe</a>'
    menu1[2]='<a href="updt_refin.php">Update Refining Recipe</a>'
    menu1[3]='<a href="updt_fini.php">Update Finishing Recipe</a>' 
    And if I place it like this :
    PHP Code:
    menu1[0]='<a href="' append_sid('add_refin.php') . '">Add Refining Recipe</a>' 
    The menu is no longer appearing.

    So far my menu is written like this :

    PHP Code:
    echo('<a href="' append_sid('forum/index.php') . '" target="_self"><img src="img/button_forum.jpg" /></a>'); 
    echo(
    '<a href="' append_sid('index.php') . '" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, \'150px\')" onMouseout="delayhidemenu()"><img src="img/button_add.jpg" /></a>'); 
    But the problem is that I loose the session if I click on the links in the drop down menu.

    There surely exists a way to add the "append_sid" but I think I have reached the low level of knowledge I have.

    Is there any kind person to help me, please ?

    Best regards,

    Fandaor

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    JavaScript is no different from regular HTML when it comes to using PHP to output them. Just envision how you'd like the final output to be, and use PHP in the relevant areas of your menu item text so it's dynamically generated as desired. Something like:

    Code:
    menu1[0]='<a href="<?=append_sid('add_refin.php')?>">JavaScript Kit</a>'
    You shouldn't have to dynamically modify the code of Step 2 at all, as you've done above with:

    Code:
    echo('<a href="' . append_sid('forum/index.php') . '" target="_self"><img src="img/button_forum.jpg" /></a>');  
    echo('<a href="' . append_sid('index.php') . '" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, \'150px\')" onMouseout="delayhidemenu()"><img src="img/button_add.jpg" /></a>');

    I don't see how that part is relevant as far as appending a sid to the menu URLs.

  3. #3
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Marvelous !!!

    Sorry for the question but I have completely forgot the syntax in the JScript ^^

    Code:
    menu1[0]='<a href="<?=append_sid('add_refin.php')?>">JavaScript Kit</a>'
    It work perfectly !


    Many thanks again


    Fandaor

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •