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

  1. Create a php document that uses arrays to store and display a list of tasks or favorite movies or books .
  2. Demonstrate the use of cookie by storing the name of the user and retrieve it every time the user requests a page.
  3. Demonstrate an example of session.

Here is the image of an example for reference.

 Create a php document that uses arrays to store and display

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) ; sJul> Tasks:/h2 ioh pmere are to tasts in the task ist.cpp cul> php foreachc stask list as sid-stask ): ?php endforeach;> 4?php endif; chzadd Task:/h2 eform action 'assigment.php" method post 4iphp foreach stask list as Stask :> cinput types hidden" nane "tasklist value,-ecto stask; 7,-> 47php endforeach; > clabelsTask:/label> Nane: cinput type. subnit nane. action" value."dd Task /for /body e/html>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!