Question: Create a php document that uses arrays to store and display a list of tasks or favorite movies or books . Demonstrate the use of
- Create a php document that uses arrays to store and display a list of tasks or favorite movies or books .
- Demonstrate the use of cookie by storing the name of the user and retrieve it every time the user requests a page.
- Demonstrate an example of session.
Here is the image of an example for reference.
2php session starto; I/start the PHP session function i1(isset(s-sesst 'page-count'))) 8 session Example 9550008850 SESSION page count'-1 else SESSIONE page count'1- echo 'you are visitor numberstSSIONE page count']-'; r cookie Example* II unset(S cooKEE name'): You can use this unset the cookie Snase filter input (INPUT POST, ase) if (issetCS COOKIE['name'])) echo welcome cOOKIE"me'1:) setcookie(ase",snane, tise-30 24): array Example stask-list . filter-input(I PUT-POST, FILTER REQUIRE ARRAY) 'tasklist', 'LTER-DEFAULT, if (Sta _1st NULL) ( stask list-arrayO Saction. filter_input (INPUT POST, action) Serrors array(O: Snew task filter input (INPUT POST, 'newtask') if (empty(Snew task)) ( serrors1 The new task cannot be empty- ' array push(stask list, snewtask) else DOCTYPE html> title Task List Ranagercbody> chi>Task List Managerc/hi e/header> ?php if (count (Serrors) e): sh2 Errorsin2> cul> foreach($errors asserror) ;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
