I don't know if what I want to do is being done anywhere else, but here's what I need to do.

I have some simple code that places a graphic floating over a webpage in an absolute position. By using the "include' command, I am taking a number from a .inc file (text file) and inserting it in the code to decide where the graphic will show up on the page. I'm not sure how to display code here and keep all the formatting visible. Maybe a screenshot.

I'll do that at the end.

I have the part I described all set. Here's the tricky part:

I need to have the number in the .inc file increment by one every two days. The number is a percent. There are 200 days before an event takes place. I want the graphic to move across the page a little bit at a time from 0% to 100% in 200 days. I could increment the file by .5 every day.

OK, so what do I use as an event to trigger the incrementing?

I plan on using an on page load event to increment the file. But if the page isn't visited every day, it will not increment properly or it will increment too fast. So instead of just incrementing each time the page is loaded, I want to run a small script each time the page is loaded.

I was thinking of using the date function, so that it knows what day it is, and it knows what day it should reach 100% and it knows what day I started.

Each time the page is loaded, the script should run. Basically, it looks at the start date which will be February 23, 2015. That is 0% so on that date, the .inc file will have a 0 in it. It knows that September 11, 2015 is the date we are counting up to, so that day is 100%. Whatever date it is when the page is opened is somewhere in-between. I need the script to figure out what percentage of the full span of time it is on any given date and overwrite the .inc file with the new amount.

I know I said increment before, but as I think of it, that would be too complicated. I think if it just deletes what was in the file and replaces it with the new number that would be best.

Is there any code that can calculate the percentage of time which has passed between two dates? That is what I need. Then I need to pass that number to the .inc file.

Sorry to ramble so much. I have included the code that I have that grabs the number from the .inc file and inserts it in the code that places the image on the page in a specific spot.

Thank you to anyone who can help!