I'm starting to mess with cookies, so I do not know much. I was wanting him to save a certain <div>
but I do not know how to do it.
How do I do:
Verify that that cookie exists:
$nomecoook = $_GET['cont'];
if(isset($_COOKIE[$nomecoook])){
}else{
$sql="SELECT img FROM fotos WHERE tkm='$tkm'";
$exe= mysqli_query($link,$sql);
$numrow=mysqli_num_rows($exe);
setcookie($nomecoook,'1',(time() + (24 * 3600)));
}
the div I want to save:
<div class="carousel-inner">
<?php
$i=0;
while($row=MYSQLI_FETCH_ARRAY($exe)){
$i++;
$img=$row['img'];
if($i==1){
?>
<div class="item active">
<img src="../_img/<?php echo e($img) ?>" alt="First Slide">
</div>
<?php
}else{
?>
<div class="item">
<img src="../_img/<?php echo e($img) ?>" alt="Second Slide">
</div>
<?php
}
}
?>
</div>
I want to save the result of this div so I do not have to do another query in the database. Can anyone help me?
Or if you have a way to save the entire page in that cookie.