Results 1 to 2 of 2

Thread: Smooth Navigational Menu (external) with dynamic PHP

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Smooth Navigational Menu (external) with dynamic PHP

    1) Script Title: Smooth Navigational Menu (v1.5)

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

    3) Describe problem: As on the developer page described I exclude the menu in an external file. I've tried to generate the links dynamicly with some short PHP (see below). As you can see it's just the page name itself, I want to dynamicly insert.

    Code at the index.php
    PHP Code:
    <?php
        $url 
    basename($_SERVER['PHP_SELF']);
    ?>
    <head>
    ...
    </head>
    <body>
    ...
    </body>
    The external php file
    PHP Code:
    <div id="language_menu" class="ddsmoothmenu">
        <ul>
            <li><a href="#">Folder 0</a>
                <ul>
                    <li><a href="<?php echo '../en/'.$url?>">Sub Item 1.1</a></li>
                    <li><a href="#">Sub Item 1.2</a></li>
                    <li><a href="#">Sub Item 1.3</a></li>
                </ul>
            </li>
        </ul>
        <br style="clear: left" />
    </div>
    As expected the skript does not what it should do (insert the variable). Are there any solutions for the problem? I'm not really familiar with AJAX (IMHO one way to solve the problem), maybe someone right here yould give me a hint.

    The rest of the script does what it should.

    Thank you very much.

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

    Default

    If the external file is in php format (.php extension), the server should parse it for any PHP code. Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

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
  •