Search the web
Sign In
New User? Sign Up
todotxt · Todo.txt
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
php interface to todo.sh   Message List  
Reply | Forward Message #1320 of 2423 |
I think that this script is helpful, but it would also be nice if I
could maintain one global copy of my todo list that I can edit from
anywhere. So, I created a php interface that will interact with a
local todo.sh to accomplish this. You could run this on your home
computer if you have a webserver running, or if you don't (like me),
you just use an automated scp command to copy down the todo.txt files
when they change.

So far as the php code goes, I coded quickly, but it appears to work
without problems. I put in only the essential features b/c I want to
be able to access this page using my phone's browser, so I needed to
keep the html size down. Still, code focus on the input line and does
an automatic refresh when items are added or removed. It also pre
formats the -h output so that it's easy to read.

Please let me know what you think.

<?php
$output = null;
$input = $_POST['input'];
if ($input == '' ) { $input = 'list'; }
?>
<html>
<head>
<?php if ( (strtolower($input) != 'list') && (strtolower($input) !=
'ls') && (strtolower($input) != 'listall') && (strtolower($input) !=
'lsa') && (strtolower($input) != 'listpri') && (strtolower($input) !=
'lsp') && (strtolower($input) != '-h') ) { echo "<meta
http-equiv=\"refresh\" content=\"3\">\n"; } ?>
<title>USERNAME Todo List</title>
</head>
<body onload="document.todo.input.focus()">
<br />
<form name="todo" action="t.php" method="post">
<input type="text" size=75 name="input">
<input type="submit" value="Submit">
</form>
<hr />
<?php

function t_echo($value)
{
print "$value <br \/>";
}

exec('/home/USERNAME/bin/todo.sh -p -v -f -d /home/USERNAME/.todo
'.escapeshellcmd($input), $output);

if ($input == '-h') { echo "<pre>"; }
array_walk($output, 't_echo');
?>
</body></html>




Fri Aug 17, 2007 3:15 pm

joshdcurry
Offline Offline
Send Email Send Email

Forward
Message #1320 of 2423 |
Expand Messages Author Sort by Date

I think that this script is helpful, but it would also be nice if I could maintain one global copy of my todo list that I can edit from anywhere. So, I created...
Joshua D. Curry
joshdcurry
Offline Send Email
Aug 17, 2007
3:19 pm

... I know this is an old thread, but I've updated Joshua's php script. The code is a lot larger, but I've added several features. Now, you can print directly...
nesman_64
Offline Send Email
Jun 10, 2008
4:04 pm

Sounds like a great idea. But, and excuse the newbie-ish type question, how do you get it up and running with minimal PHP experience?...
Dan DeLaiarro
dan_delaiarro
Offline Send Email
Jun 10, 2008
8:43 pm

... and ... The easiest way to set up a php web server is xampp from http://www.apachefriends.org/ They make it so easy, it's hard to believe. Works in...
nesman_64
Offline Send Email
Jun 16, 2008
2:52 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help