I am working on the logout of my site and I am having trouble with it. If I hit the log out button I go back to the index and if I then hit the return button in my browser I go back to the page where I was logged in. My question is how do I detroy the session right to prevent this from happening.
Here is the script if someone is logged in:
<?php
session_start();
?>
<html>
<head>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,300,200' rel='stylesheet' type='text/css'>
</head>
<body>
<section class="photoContainer hero" data-stellar-background-ratio="0.5 ">
<div class="content">
<div class="hC">
<h1>Presenting E-bike</h1>
<h3>Why Pedal When You Don't have Too</h3>
</div>
<div class="panelContainer">
<div class="panel3">
<div class="symbol2"></div>
</div>
</div>
<div class="inlog">
<a class="btn" href="../index.php">Log Out</a>
<?php
session_destroy();
?>
</div>
</div>
</section>
<section class="wrapper">
<div class="content">
<h2>FAQ</h2>
<p>This is where you will find the answers on the most frequently asked questions.</p><br />
<p><b>Q:</b> What is a content management system?<br />
<b>A:</b> A CMS is a web application you run on your web server to help creating a website. A good CMS should be flexible and help you to make a great site. It should provide you with tools to help the layman keep track of content, while letting more experienced webmasters handle look and feel. It should also provide tools to make repetitive things less repetitive. Like, for example, News entries.<br /><br />
</p>
<p><b>Q:</b> Why do I need a Web Content Management System? <br />
<b>A:</b> If you have a website, you need to have some sort of CMS. The more sophisticated your CMS, the more things you can do with your site. <br /><br />
</p>
<p><b>Q:</b> Is prior web site development experience required to use a CMS? <br />
<b>A:</b> No. If you can use Microsoft Word you will have no trouble editing content on your website. No HTML or coding is required. <br /><br />
</p>
</div>
</section>
<section class="photoContainer middle" data-stellar-background-ratio="0.5">
<div class="content">
<div class="panelContainer">
<div class="panel2">
<div class="symbol3"></div>
</div>
</div>
</div>
</section>
<section class="wrapper">
<div class="content">
<h2>This is how your title would look.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis tempus risus et tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In vehicula dui pretium magna sodales semper. Nunc faucibus mauris ante, in egestas urna tempus nec. Fusce rutrum est sit amet augue egestas gravida. Sed varius dui ac urna scelerisque euismod. Fusce mattis aliquam dolor at lobortis. Proin semper nulla ut nunc aliquam ultricies sed non nulla. Proin eleifend quis libero sed sodales. Mauris quis imperdiet sapien, quis facilisis orci.</p>
<h4>This is how your subtitle would look.</h4><br />
<p>Suspendisse potenti. Nunc mollis tellus ac dolor feugiat sagittis. Sed sit amet ex porta, dictum tellus quis, rhoncus arcu. Sed suscipit a orci at viverra. Integer non sem nec sem consequat efficitur et vitae dolor. Etiam dignissim dui in est porta congue quis id nulla. Integer tincidunt diam volutpat lacus finibus lobortis. Quisque ultricies scelerisque rhoncus.</p>
</div>
</section>
<section class="photoContainer middle2" data-stellar-background-ratio="0.5 ">
<div class="content">
<div class="panelcontainer">
<div class="panel1">
<div class="symbol"></div>
</div>
</div>
</div>
</section>
<section class="wrapper">
<div class="content">
<h2>Contact</h2>
<p>If you have any questions, or need more information, you will be able to contact us with the following information.</p>
<br />
<p>Telephone: (0800)12341833</p>
<p>E-mail: <a href="../404.html">thebestcms@site.com</a></p>
<p>Address: <a href="../404.html">GoogleMaps</a></p>
</div>
</section>
<section>
<div class="copyright">
<p>Copyright © 2016 1P6 Landstede - All rights reserved</p>
</div>
</section>
<script src="../js/jquery-2.0.2.js"></script>
<script src="../js/jquery.stellar.min.js"></script>
<script>
$.stellar();
</script>
</body>
</html>
If needed I also will put in the index.php
<html>
<head>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,300,200' rel='stylesheet' type='text/css'>
</head>
<body>
<section class="photoContainer hero" data-stellar-background-ratio="0.5 ">
<div class="content">
<div class="hC">
<h1>Presenting E-bike</h1>
<h3>Why Pedal When You Don't have Too</h3>
</div>
<div class="panelContainer">
<div class="panel3">
<div class="symbol2"></div>
</div>
</div>
<div class="inlog">
<a class="btn" href="login/login.php">Login</a>
</div>
</div>
</section>
<section class="wrapper">
<div class="content">
<h2>FAQ</h2>
<p>This is where you will find the answers on the most frequently asked questions.</p><br />
<p><b>Q:</b> What is a content management system?<br />
<b>A:</b> A CMS is a web application you run on your web server to help creating a website. A good CMS should be flexible and help you to make a great site. It should provide you with tools to help the layman keep track of content, while letting more experienced webmasters handle look and feel. It should also provide tools to make repetitive things less repetitive. Like, for example, News entries.<br /><br />
</p>
<p><b>Q:</b> Why do I need a Web Content Management System? <br />
<b>A:</b> If you have a website, you need to have some sort of CMS. The more sophisticated your CMS, the more things you can do with your site. <br /><br />
</p>
<p><b>Q:</b> Is prior web site development experience required to use a CMS? <br />
<b>A:</b> No. If you can use Microsoft Word you will have no trouble editing content on your website. No HTML or coding is required. <br /><br />
</p>
</div>
</section>
<section class="photoContainer middle" data-stellar-background-ratio="0.5">
<div class="content">
<div class="panelContainer">
<div class="panel2">
<div class="symbol3"></div>
</div>
</div>
</div>
</section>
<section class="wrapper">
<div class="content">
<h2>This is how your title would look.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis tempus risus et tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In vehicula dui pretium magna sodales semper. Nunc faucibus mauris ante, in egestas urna tempus nec. Fusce rutrum est sit amet augue egestas gravida. Sed varius dui ac urna scelerisque euismod. Fusce mattis aliquam dolor at lobortis. Proin semper nulla ut nunc aliquam ultricies sed non nulla. Proin eleifend quis libero sed sodales. Mauris quis imperdiet sapien, quis facilisis orci.</p>
<h4>This is how your subtitle would look.</h4><br />
<p>Suspendisse potenti. Nunc mollis tellus ac dolor feugiat sagittis. Sed sit amet ex porta, dictum tellus quis, rhoncus arcu. Sed suscipit a orci at viverra. Integer non sem nec sem consequat efficitur et vitae dolor. Etiam dignissim dui in est porta congue quis id nulla. Integer tincidunt diam volutpat lacus finibus lobortis. Quisque ultricies scelerisque rhoncus.</p>
</div>
</section>
<section class="photoContainer middle2" data-stellar-background-ratio="0.5 ">
<div class="content">
<div class="panelcontainer">
<div class="panel1">
<div class="symbol"></div>
</div>
</div>
</div>
</section>
<section class="wrapper">
<div class="content">
<h2>Contact</h2>
<p>If you have any questions, or need more information, you will be able to contact us with the following information.</p>
<br />
<p>Telephone: (0800)12341833</p>
<p>E-mail: <a href="404.html">thebestcms@site.com</a></p>
<p>Address: <a href="404.html">GoogleMaps</a></p>
</div>
</section>
<section>
<div class="copyright">
<p>Copyright © 2016 1P6 Landstede - All rights reserved</p>
</div>
</section>
<script src="js/jquery-2.0.2.js"></script>
<script src="js/jquery.stellar.min.js"></script>
<script>
$.stellar();
</script>
</body>
</html>