Random Text FAQ

Frequently asked questions about the Random Text script.

Q1: How do I add my own quotes or text?

Short Answer:

Edit the text data file, one quote per line.

Long Answer:

The Random Text script reads from a simple text file with one entry per line:

Example Data File (quotes.txt):
The only way to do great work is to love what you do. - Steve Jobs
In the middle of difficulty lies opportunity. - Albert Einstein
Life is what happens when you're busy making other plans. - John Lennon
The future belongs to those who believe in the beauty of their dreams. - Eleanor Roosevelt

Q2: Can I use HTML in my random text?

Short Answer:

Yes.

Long Answer:

You can include HTML tags in your text lines. They will be output as-is:

Example with HTML:
<b>Bold quote</b> - Author Name
<i>Italic quote</i> - Another Author
<font color="red">Colored quote</font> - Third Author
<a href="http://example.com">Click here</a> for more info
Popular Uses:
  • Random quotes with formatting
  • Rotating banner text
  • Daily tips with links
  • Motivational messages

Q3: How do I make the text change on each page load?

Short Answer:

Use SSI or call the script directly.

Long Answer:

There are several methods to display random text that changes on each page load:

Method 1: SSI (Recommended)
<!--#include virtual="/cgi-bin/rand_text.cgi"-->

Executes the script on each page load. Requires SSI enabled on your server.

Method 2: Direct Call
<iframe src="/cgi-bin/rand_text.cgi"></iframe>

Embeds the output in an iframe.

Q4: Can I have multiple random text files?

Short Answer:

Yes, use different data files.

Long Answer:

You can have different sets of random text for different purposes:

Example Setup:
# quotes.txt - inspirational quotes
# tips.txt - daily tips
# news.txt - company news
# taglines.txt - marketing taglines

Pass the filename as a parameter:

<!--#include virtual="/cgi-bin/rand_text.cgi?file=quotes"-->
<!--#include virtual="/cgi-bin/rand_text.cgi?file=tips"-->

Related FAQs

Random Link FAQ

Questions about random links

SSI Random Image FAQ

Questions about random images

All FAQs

Browse all script FAQs