Slip no. 13 & Slip no. 23
Write a PHP script to check how many times the web page access.[ Use cookies]
PHP file :
<?php
if(isset($_COOKIE['cnt']))
{
$x=$_COOKIE['cnt'];
$x=$x+1;
setcookie('cnt',$x);
}
else
{
setcookie('cnt',2);
echo "you accessed this page 1st time";
}
echo "you accessed this page $x times";
?>
Write a PHP script to check how many times the web page access.[ Use cookies]
PHP file :
<?php
if(isset($_COOKIE['cnt']))
{
$x=$_COOKIE['cnt'];
$x=$x+1;
setcookie('cnt',$x);
}
else
{
setcookie('cnt',2);
echo "you accessed this page 1st time";
}
echo "you accessed this page $x times";
?>
0 Comments