SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question want active page to display different css...

    hi there,

    got a list of links as follows (links.inc.php):
    PHP Code:
    <?php
    $links
    []="<a href=\"index.php\" title=\"football.lu\">home</a>";
    $links[]="<a href=\"competitions.php\" title=\"national & international competitions\">competitions</a>";
    $links[]="<a href=\"organisation.php\" title=\"»history  »general info  »downloads\">organisation</a>";
    $links[]="<a href=\"news.php\" title=\"what's new?\">news</a>";
    $links[]="<a href=\"clubs.php\" title=\"clubs a-z\">clubs</a>";
    $links[]="<a href=\"shop.php\" title=\"»tickets  »gear\">shop</a>";
    $links[]="<a href=\"links.php\" title=\"links\">links</a>";
    $links[]="<a href=\"contact.php\" title=\"how to contact us\">contact us</a>";
    $links[]="<a href=\"sitemap.php\" title=\"where do i find what?\">site map</a>";
    ?>
    now i want them to be displayed on the page:
    PHP Code:
    <?php require("flf_navigation/links.inc.php");?>

    <ul><?php
    foreach ($links as $link) {
             echo
    "<li>$link</li>";
                                      }
    ?></ul>
    so far so good... but i'd like the link to the page that we're currently on to use a different css (ueberlink)

    i have managed to do something like this before:
    PHP Code:
     <?php
        $path 
    pathinfo($_SERVER['PHP_SELF']);
        
    $title substr($path["basename"],".php",-4);
        if (
    $title=="index"){
        echo 
    "Welcome";}
        else {echo 
    ucfirst($title);}
     
    ?>
    can i use something similar? is there an obvious function of which i don't know?

    please help



    lister
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  2. #2
    SitePoint Evangelist
    Join Date
    May 2004
    Location
    Germany
    Posts
    550
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about
    Code:
    a:active {
      //css for active page goes her
    
    }
    this in a css file should work?

  3. #3
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that only works for the seconds (period of time) that the page flicks over to the next one... it doesn't stay on the current page as far as i've tried and know
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  4. #4
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please... anybody?
    -i'm still stuck at this
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  5. #5
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lets try to make it more understandable... how do i get this, using php:

    on page1:

    link1
    link2
    link3
    link4
    ...

    on page2:

    link1
    link2
    link3
    link4
    ...


    and so on... please help


    lister
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!


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
  •