06 cookie Program PHP- record

sava--cookie6.php 

program:-

 <?php
$cookie_name = "user";
$cookie_value = "IBM Degree College";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
?>
<html>
<body>

<?php
if(!isset($_COOKIE[$cookie_name])) {
  echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
  echo "Cookie '" . $cookie_name . "' is set!<br>";
  echo "Value is: " . $_COOKIE[$cookie_name];
}
?>

</body>
</html>

output:-01



 

output:-02

 

Comments

Popular posts from this blog

SOFTWARE

Unit 2: Foundations of Ownership, Security Related Concepts in Blockchain

e-com sem-3

Unit-1 Foundations of Software Systems and Blockchain

6)what are the various service of internet and protocols ICT-unit-1

digital marketing ppt-u1

Unit-V: Image Manipulations, Audio and Video & Introduction to JavaScript

Unit-III: Cascading Style Sheets (CSS) - HTML

Unit-II: HTML Coding Standards & Elements

1) Information and Communication Technology ICT-unit-1