#76 Displaying Random Text
The built-in server-side include features offer some wonderful ways to expand and extend your website. One way that's a favorite with many webmasters is the ability to have an element of a web page change each time the page is loaded. The ever-changing element might be a graphic, a news snippet, or a featured subpage, or it might just be a tag line for the site itself, but one that's slightly different for each visit to keep the reader interested and — hopefully — coming back for more.
What's remarkable is that this trick is quite easy to accomplish with a shell script containing an awk program only a few lines long, invoked from within a web page via an SSI include (see Script #75 for an example of SSI directive ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access