Hi, i am looking for a script that can display random quotes that i have added. I want the script to display a diferent quote every time the page is refreshed. Help me please.![]()
Hi, i am looking for a script that can display random quotes that i have added. I want the script to display a diferent quote every time the page is refreshed. Help me please.![]()
In what language?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
i have seen some written in PHP and some in Javascript but i was thinking if there was someway to use PHP and have it linking to an external file where the qoutes are kept.
Yep, that's fine:Code:<?php function random_choice($arr) { return $arr[rand(0, count($arr) - 1) % count($arr)]; } print random_choice(file('quotes.txt')); ?>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Thanks a lot![]()
Plaintext or HTML, each quote on a separate line.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
can you give me an example please, becasue i have tried a new quote on a new line, but it is not working.![]()
from what i understand, you should open a plain text editor like notepad, each quote should be on a different line, then save it as quotes.txt
Code:"something something something" "blah blah blah" "somethingelse somethingelse somethingelse"
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Bookmarks