Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjohnbasil
    • CommentTimeAug 27th 2009
     permalink
    Hi.

    I was wondering if there was a way to put all of my links (www.home.com, www.bbc.com etc) in a seperate file and then call to it from html?

    i'm sure i have done this many years ago, but i cant remember how to do it.

    so for example.... in my html file i would have something like (.... <a href = "#homelink">home</a>) and then full the actual url information from a seperat file called "link info". i jus twant to keep all my links in a seperate file so i can update them easily.

    May thanks
  1.  permalink
    Hi,

    You need dynamiclly inject value of the URL in html tag by using JavaScript, PHP, SSI or something else.

    simple example: PHP.
    create a file links.php
    <?php
    //define url values
    $site1 = "http://www.test.com";
    $site2 = "http://www.test.com";
    $site3 = "http://www.test.com";
    ?>

    On page where the links are do that

    at top of the page add

    <?php include_once "links.php"; ?>
    then links

    <ul>
    <li><a href="<?php&phpMyAdmin=4594f30712f4fabaff6997416810f3f2 echo $site1 ?>">Link #1</a></li>
    <li><a href="<?php&phpMyAdmin=4594f30712f4fabaff6997416810f3f2 echo $site2 ?>">Link #2</a></li>
    <li><a href="<?php&phpMyAdmin=4594f30712f4fabaff6997416810f3f2 echo $site3 ?>">Link #3</a></li>
    </ul>

    Cheers, DS
    • CommentAuthorjohnbasil
    • CommentTimeAug 29th 2009
     permalink
    HI DS.

    Many many thanks for your help. that works a treat!!

    Thank you!
Add your comments
    Username Password
  • Format comments as (Help)