我有一个html页面,其中包含通过幻灯片放映的所有幻灯片,而javascript仅使用id将它们放在新的单独页面上。单击下一个箭头时,它将带用户到下一张幻灯片(在URL中您将看到标签ID。我需要能够将该ID号保存在名为checkPointMod
的表中基本上是我要保存某人获得的地方(几乎保存他们的进度?)
下面的html快照:
<?php $_COOKIE["PageNo"]++; ?>
<section class="aligncenter">
<span class="background light" style="background-image: url('istudy_slides_images/abstract2.jpg')"/></span>
<div class="wrap" id="slide=6">
<div class="wrap">
<h1>Stress is often defined as when an individual perceives the demands upon them to exceed there perceived ability to cope</h1>
</div>
</section>
<!-- SLIDE 6 -->
<?php $_COOKIE["PageNo"]++; ?>
<section>
<span class="background" style="background-image:url('istudy_slides_images/balance.jpg')"></span>
<div class="wrap" id="slide=7">
<div class="alignright size-50 bg-trans-dark">
<p class="text-subtitle text-serif">"In the end, it's all a question of balance" - Rohinton Mistry</p><br>
<h3><strong>Balance</strong></h3>
<p>A common source of stress and anxiety is when we lack balance within our lives</strong>.
A good work life balance is one where we invest equally into all areas of our life including our educational work and within our personal life.</p>
</div>
</div>
</section>
我与我的一个同伴交谈,他告诉我使用$_COOKIES
,将页码保存在其中,然后使用插入/更新查询将其放入表格中,因此位于html的顶部我尝试过的页面:
setcookie("PageNo", 0, time() + (86400 * 30), "/");
然后,您可以在代码段中看到我的
<?php $_COOKIE["PageNo"]++; ?>
但是,这样做似乎是一个漫长的过程(我也无法使其正常工作),有没有更简单的方法来使用slide=id-'x'
并将其插入到我的表中?