I have developed an application for dental offices which sends automatic email and sms reminders at preset time of the day. This will be a local php application installed on client's machine since the database is local. I want to make it a monthly subscription service. In order to implement the subscription logic, my idea is to keep a text file on my server which will have an expiration date. The local application will read the contents of the text file to make sure that the subscription is not expired.
Now the problem is, when I use file() or file_get_contents() function in my script to read the text file on my server (for example, www.abcde.com/expiration.txt), it keeps forever to read the text file. Now if I directly put the url of the text file in seperate browser window, it opens it right away. Once I do that, the php script works fine. Again after a while, same cycle starts.
- Am I missing something here?
- Is there a better way to achieve the subscription logic?
My php application is 'local' using wamp server.