Your project will contain a mixture of:
- HTML
- javascript
- PHP
- MySQL (optional)
Things to consider:
(1) Where to store the list? Options include: PHP text file, or MySQL database. Database is best idea and will probably be easiest to code, all things being equal. Of course, if you do not need the To Do Lists available online, you can also choose store the lists in localstorage
in each user's browser. Then there is no need for PHP or MySQL, both of which run on the webserver. If you are doing this as an exercise to learn web programming, but you do not have access to a web hosting account, then download xampp
and set up a proper web server on your own computer - hint: the HTML files go inside c:\xampp\htdocs, and you see the website by typing localhost
(nothing else) in the browser address bar
(2) HTML. You will need two things: (a) display the completed ToDo List, and (b) the ability to add new items to the list.
(3) Display current list. Get the list values from database (or file) and read into an array (an array is like a train where each boxcar is a variable name containing data). Then, loop through the array to create the HTML to display your current list.
(4) After creating HTML for the list, add a bit of HTML (perhaps a button with a label) to allow creating a new list item.
(5) When button pressed, display a form with appropriate fields to allow user to add a new To Do List item. Note that this does not need to be an HTML <form>
-- you can use DIVs and input fields, and then use jQuery to read the field values and AJAX to stick the data values into the database.
Helpful simple examples re AJAX are here:
AJAX request callback using jQuery