Page 280 - Computer Software Application TP - Volume 1
P. 280
COMPUTER SOFTWARE APPLICATION - CITS
<html>
<body>
<?php
// Start the session
session_start();
// Unset a session variable
unset($_SESSION[‘username’]);
unset($_SESSION[‘user_email’]);
// Destroy all session data
session_destroy();
echo “All session data successfully removed”;
?>
</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
TASK 10: Working with the query string
I Creating a query string
1 Open the text editor
2 Write the following codes
<html>
<body>
<?php
$data = array(
‘name’ => ‘John Doe’,
‘age’ => 30
);
$query_string = http_build_query($data);
265
CITS : IT & ITES - Computer Software Application - Exercise 54 CITS : IT & ITES - Computer Software Application - Exercise 54