Sessions
Posted: Mon Nov 14, 2011 9:05 am
I have written four php files and linked them. I want a session which stores the path from where i come to that page(all the pages i viewed). how should i write and include a session in the files so that it stores the path. The session should capture all the pages i viewed. Please help i am not good with sessions.
1.Referer file
2.index file
3.Aboutus file
4.Services file
thankyou.
1.Referer file
Code: Select all
<?php
echo "<p> Referred by : ".basename($_SERVER['HTTP_REFERER'],".php");
?>Code: Select all
<html.
<body>
<?php
require "referer.php";
?>
<h1>Index</h1>
<a href="aboutus.php">link</a>
</body>
</html>Code: Select all
<html.
<body>
<?php
require "referer.php";
?>
<h1>About us</h1>
<a href="services.php">link</a>
</body>
</html>4.Services file
Code: Select all
<html.
<body>
<?php
require "referer.php";
?>
<h1>Services</h1>
<a href="Index.php">link</a>
</body>
</html>thankyou.