Page 283 - Computer Software Application TP - Volume 1
P. 283

COMPUTER SOFTWARE APPLICATION - CITS



                 ?>
                       </body>
                                </html>

           3  Save the program in C:\Apache24\htdocs in a folder with .php extension
           4  Run the Apache services from windows services
           5  Open the browser and type the following address
                                  http://localhost/foldername/
           6  Click the php file to run  and verify the output

              1  Provide a code example demonstrating how to set a cookie with the value that expires in 24 hours.
              2  Provide a code example demonstrating how to retrieve the value of a cookie named   “username” set in
                 a previous request.
              3  Provide a code example demonstrating how to delete a cookie named “username” that was previously
                 set.
              4  Provide a code example demonstrating how to start a session and set a session variable named
                 “myname” with the value “CSATRAINEE”.
              5  Provide a code example demonstrating how to modify the value of the session variable “username” set
                 in a previous request.
              6  Provide a code example demonstrating how to unset the session variable “username”.
              7  Write a PHP code snippet generating a unique session ID, associating it with a session, and storing it in
                 a cookie

              8  Provide examples of how to add query string parameters programmatically, either within the same page
                 or when redirecting to another page.














































                                                           268
                                CITS : IT & ITES - Computer Software Application - Exercise 54
   278   279   280   281   282   283   284   285   286   287   288