“Quote of the Day” is quite an old feature, people put on their sites. And of course people like it; I mean who doesn’t like to know the sayings of great persons! In this post we’re going to design a complete quote of the day system to place on our web site. The title is a bit misleading actually, because most of these types of scripts show a new quote (randomly) each time the page is requested and not once a day. So if you incorporate this script on our web site, you’d see a different quote each time you reload the page. You may easily change it to “actually” display different quotes for each day only but people like that random one! The working of the quote scrip is pretty simple. We first store a good number of quote in an array (here we’ll just be storing a handful as an example). Generate a random number from 0 to NUM_ELEMENTS_IN_ARRAY-1 and just show the quote from the array with that index. Here i...
A resource for learning PHP, HTML, CSS, JavaScript, C++, etc.