@celauran ! yes i had the same concern that PHP might not be the right fit for the job. so i'll explain in detail how this app works so far,
So suppose i have two two input elements on myfrontend , one accepts a task and the other accepts a date and time in the future.
So the input element looks something like
http://imgur.com/4a1Ko9T.
Now when the user in the frontEnd enters a task and also a date and time and clicks on submit , so of now i am storing these details in localstorage and simultaniously also a setTimeout is activated to notify the user of the task(to whenever the user has set the time to in the frontEnd). So once the settimeout Runs basially a function is called which notifies the user with a HTML5 notification , it just mentions the task to be performed.
Now obviuosly there are a couple of issues with this one being localStorage can be easily manupulated using the dev tools , the other being localstorage can't be accessed in another browser I.E. the localstorage object stored in one browser can't be accessed in another browser.
the reason i want to use PHP/mySqli is that obviously storing the users tasks in a database is much safer , so that a clear advantage. Iám just thinking , well how do i run a timer(or something of that sort in PHP) , so that the user is notified.
ONE WAY TO DO THIS WOULD BE::
- Accept user input (Task and date/time).
- Save date to the database/ Simultaniously activate a setTimeout to run.
- When the setTimeout Runs query the database again , get the tasks and show the user in an HTML5 notification. (Here i am asssuming two things , that no two tasks will be set to the same time as when the setTimeout runs , it will compare the current time to the time of all the tasks in the database and the tasks that has a time set to the current time , will be selected.)
Another scenario would be .....
- User enters a Task and date/time .
- Save date to the database/ Simultaniously activate a setTimeout to run.
- user Closes the browser.
- User reopens the browser and NOW ......... Run a Query to select all the tasks and set a setTimeout for each task.
- When the setTimeout Runs query the database again , get the tasks and show the user in an HTML5 notification.
Ok , so i have listed a approach above , @celaurian , i would like to know what your opinion is of the above approach.
Since you mentioned "the right tool" ... A Firefox or chrome browser extension would be a perfect fit for this kind of an app... and you might even be thinking well , why would the user want to keep a separate tab open in the browser just to be notified of a task .... Why not just build a brower extension then ???
Well the answer to the above is i just as of now , with my current requirements need to build this application as a web app , w()hen the user indeed has a tab open for the notification to be displayed. (in the future i will find a way around how to close the tab and still notify the user in someway.)
@celauran , if you have any questions please feel free to ask.
BTW , this app as of now is just for my personal use , not for any commercial purpose.