word count script for session, iframe

word count script for session, iframe

Page 1 of 1

0 Replies - 917 Views - Last Post: 16 April 2009 - 09:38 AM

#1 orionrush   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 11-April 08

word count script for session, iframe

Post icon  Posted 16 April 2009 - 09:38 AM

I need as lightweight script that is heavily commented to do the following task:

I have a design for a small PHP site site that will randomly load a new bit of text into a iframe when the user hits the 'next' button. On first load the script needs to know the number of words in the text. As the number of words is predetermined, the script need not actually count the number of words (though it could) but read from the database how many words have been read. As the reader moves forward through the site (each page in the iframe will be delivered randomly) I want the script to alert the reader as to how many words they have read. As that number increases I need to have the alerts say different things at different benchmarks. For example:

You've read 100 words so far only 8,000 to go!
You've read 7,000 so far - don't you think its time you called it in?
You've read 8,000 so far you really are a glutton for punishment!

As for the random order of the text - I was thinking I might deliver them to the iframe via a random order call to MySQL database I have set up. However I'm not sure if I'll be able to prevent the same page from coming up more then once per session.

Also its not the ammount of words on the page that is difficult(for me) but rather remembering the total form iframe load to iframe load.

Need a time line and estimate for this job.

Cheers,
ben

Is This A Good Question/Topic? 0
  • +

Page 1 of 1