|
Hate UML?Draw sequence diagrams in seconds.http://www.websequencediagrams.com |
Go to http://gandolf.homelinux.org/~smhanov/todo/ to try it out.
Here's the php source code.
A unique thing about the Todo list is that it lets you add things without signing in. They are stored in the PHP $_SESSION variable. If you later create an account, or sign in, then the items are transferred to the mysql database.
Want more programming tech talk?Terminology
Actually, I hate the term Ajax. The X stands for XML, but I personally think that just about every use of XML is a mistake. I don't use any XML in my Todo list. Instead, it does all of its communication in either POST requests, or JSON.
About the Application
I have a slow server, so if there is a choice between doing something in php and javascript, the javascript wins. The script is one file, index.php, of which 470 lines are in php, and 733 are in Javascript/HTML.
Things I learned
Add to Circles on Google Plus
Subscribe to posts
CREATE DATABASE IF NOT EXISTS Todo;
USE Todo;
CREATE TABLE IF NOT EXISTS auth (
username CHAR(60) NOT NULL PRIMARY KEY,
password TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS Todo (
ID INT NOT NULL PRIMARY KEY,
username TEXT NOT NULL,
item TEXT NOT NULL
);
Please explain once again, what files must be in my todo instalation folder?
Thanks
In the web server, you will need index.php, done.png, and undone.png. The index.php file can be downloaded above. The image files, which are images of check boxes, can be downloaded by using the todo list and clicking "Save image as..." in your browser.
but it doesnt connect to the db.
is there any way to convert this mysql:// line to the regular php line with
@mysql_connect('host', 'user', 'pass') or die();
mysql_select_db('table') or die();
?
please.
Sure, you can convert all of the DB:: calls to use the native php mysql functions. But I don't know how. I only learned how to use php pear.
To install php-pear on linux, use 'apt-get php-pear'. To learn about it, search for "php pear" on Google.
Does the edit option works on your machine?? Cuz mine doesn't.
Also it would be nice if you can also provide the .js files on this page. I was struggling for a while to set the script up.
Thanks!!
I think there is a bug in line 726 of the index.php
this.originalText = form.bigtext.firstChild.nodeValue;
should be
this.originalText = form.bigtext.value;
This should fix the edit problem.
Thanks
upclicked and downclicked functions are not defined.
when move up or down is clicked nothing happens
- change the database schema to add in another column, eg. "rank"
- When you move them up / down, change the database to renumber them all.
I didn't do it because I hate the idea of renumbering them all individually whenever you click the up/down button -- if you had thousands of items it would be very slow. There's probably a way in SQL to do it efficiently.
I am trying to use this list in a university project where we are creating a website. My role involves creating a todo list for a moving companys website. The list that we are expected to use is pretty much similar to yours. I have tried copying the source code from your list into my 'todo list page' on the website and it appears to work when I start debugging and the website opens up but when i try to add an item it doesnt appear below like it does on your version on your website.
I am using Microsoft visual studio VB 2008.
I am really new to making websites so any help on how i could make this list work in my website would be muchly apprectiated. My email is tom_da_bom@hotmail.com
Many many thanks i really like your list
Tom
5 years after you first posted it :-)
Post comment