Question: i got below code here together with the Tasks.php code and its working as expected improve the estatics of below images 1 . change colour
i got below code here together with the Tasks.php code and its working as expected
improve the estatics of below images
change colour of add task button to be blue
Visualise the added task in a table similar to the one in mysql table, eg change heading Task to Description
add backgroud colur to the webpage to be light blue and modern
Create a PHP file named inde tox.php and add the following code:
setAttributePDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION;
catch PDOException $e
dieCould not connect to the database: $egetMessage;
Handling form submission to add a new task
if $SERVERREQUESTMETHOD' 'POST' && isset$POSTtaskdescription'
$description $POSTtaskdescription';
$task new Task$description;
$stmt $pdoprepareINSERT INTO tasks description VALUES :description;
$stmtexecutedescription $taskgetDescription;
headerLocation: index.php;
exit;
Handling task completion
if isset$POSTtaskid && isset$POSTcompleted
$taskId $POSTtaskid;
$completed $POSTcompleted true : false;
$stmt $pdoprepareUPDATE tasks SET completed :completed WHERE id :id;
$stmtexecutecompleted $completed, id $taskId;
headerLocation: index.php;
exit;
Fetching existing tasks
$stmt $pdoquerySELECT FROM tasks";
$tasks $stmtfetchAllPDO::FETCHASSOC;
ToDo List
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
