I have a shoutbox on my website that writes to a file named shouts.txt
I want the text in the file to be replaced with the following every hour on the hour:

<tr>
	<td align="right" width="18%"></td>
	<td align="left" width="81%"></td>
</tr>
<tr>
	<td align="right" width="18%"></td>
	<td align="left" width="81%"></td>
</tr>
<tr>
	<td align="right" width="18%"></td>
	<td align="left" width="81%"></td>
</tr>
<tr>
	<td align="right" width="18%"></td>
	<td align="left" width="81%"></td>
</tr>
<tr>
	<td align="right" width="18%"></td>
	<td align="left" width="81%"></td>
</tr>
<tr>
	<td align="right" width="18%"></td>
	<td align="left" width="81%"></td>
</tr>
<tr>
	<td align="right" width="18%"><image src=http://funbottle.co.uk/images/arrowleft.png><i>Shoutbox</i>
	<td align="left" width="81%"><i>reset at *TIME*</i></td>
</tr>

is this possible?

    Thanks for the help but err, did I mention I'm a n00b at PHP and want someone to perhaps give me examples? XD
    I understand that the site gives me an example but I would not be sure about the timing event?

      Thanks for that, it seems that would do the job perfectly. I was looking for something a little more PHP based though so keep the suggestions coming in people 🙂

        you call the php script with a cron job, php has no native scheduling ability

          My webserver does not allow cron I believe, is there any other way?

            if your pc is running 24\7 you could hit the php script with your browser, but otherwise no, you need something sever side.

              well i guess if your not to fussy about it being hourly, you could call use the visitors hitting the fount page to call the script.

                That could be a cool idea, how would it be possible in PHP?

                  w3rra wrote:

                  That could be a cool idea, how would it be possible in PHP?

                  If you are willing to allow your users to wait a little longer every time they visit your front page then it is just a matter of silently including the code along with the rest of your front page code.

                    Write a Reply...