I am relatively a newbie to PHP. I have been able to get a page to list all my tasks in a form from my mysql database. However now I want to add a textbox against each task with some notes, and then have a button which I can click after adding the notes. Then on posting a submit, I want to add this info to my database.
Currently when I submit the form, the data is coming as blank...and hence I am unable to add the info.
My code snippet for listing the tasks in my php is:
if (isset($POST['submitted']) && !empty($POST['amount'])) {
//add to database
}
print "<form action=\"" . $_SERVER["PHP_SELF"] . "\" method=post>\n";
//get the info from database...in $task_details, task_id, $date, $time
print "<div class=box3><table width=\"100%\" border=\"0\"><tr><td width=\"90%\">".
"<table width=\"99%\" border=\"0\" ><tr><td>".
$task_details.
"</td></tr><tr><td>It needs to be done on <b>".$date."</b> at <b>".$time."</b></td></tr></table>".
"</td><td width=\"10%\">".
"<table width=\"99%\" border=\"0\"><tr><td>".
"<input type=text name=amount size=10 tabindex=1></input></td></tr>".
"<tr><td>".
"<input name=\"submitted\" type=\"hidden\" value=\"true\" />".
"<input type=submit value=\"Submit\" name=".$task_id."></input></td></tr></table></td></tr></table></div>";
Am I doing something impossible, or is there a better way to do this? Have been struggling with this for a few days now, and hence seeking help.