View Full Version : Showing 1 line of a text document per refresh

05-30-2010, 01:57 AM
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,

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.

05-30-2010, 07:59 PM
If I understand you correctly, i suggest you use 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, :)

06-07-2010, 01:48 AM
Thanks, simple and clear, i like that.