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
    New Coder
    Join Date
    May 2010
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Showing 1 line of a text document per refresh

    I would like to know if there is a way to only put 1 line of quote, for example.

    I use <iframe src=[link of .text document]> </iframe>. However, it doesnt work... Is there a code so that Frontpage will only take 1 line at a time of the text document?

    Text document is made like this :

    [1st line] Hi, my name is bob,
    [2nd line] Hello, my name is John,
    [3rd line] Hi, my name is Julie,
    etc.

    The concept is, that each refresh(or days), the table shows 1 line (randomly) of the text document. So when u enter the website, it shows [1st line], if u refresh, it shows [3rd line], for instance.

  • #2
    New to the CF scene
    Join Date
    May 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I understand you correctly, i suggest you use PHP.
    PHP Code:
    <?php
    $line
    [1] = "Hi";
    $line[2] = "HiHi";
    $line[3] = "Good luck";
    $show rand(1,3);
    echo 
    $line[$show];
    ?>
    Yeah I know I could do this more elegantly, but I wanted to get it done fast.
    And sorry I couldn't think of a HTML + CSS solution.
    You could also use JavaScript for this,

  • #3
    New Coder
    Join Date
    May 2010
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks, simple and clear, i like that.


  •  

    Posting Permissions

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