Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    252
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Dynamically inserting directory name into a file name?

    On the following url, as an example:

    http://www.mydomain.com/services/Graphic_Design/

    How can I have the code for a favicon pull from the directory name so that the code is:

    <link rel="shortcut icon" type="image/x-icon" href="/favicon_Graphic_Design.gif">

    Thanks,
    Errica

  • #2
    Regular Coder
    Join Date
    Aug 2005
    Posts
    252
    Thanks
    23
    Thanked 0 Times in 0 Posts
    OK, it seems I have this working with the following:

    PHP Code:
    <?php
    function dir_name(){
        
    $get explode('/'dirname($_SERVER['PHP_SELF']));
        return 
    end($get);
    }
    ?>

    <?php echo dir_name(); ?>
    If there's a better recommendation, let me know? Thanks!
    Errica

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Errica (12-10-2008)


  •  

    Posting Permissions

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