By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

How can i show the path of visited links on each page?

P: 71
How can i show the path of visited links on each page, suppose from home page i have visited about_us then it should be as below


Then suppose i have visited to contact_us.htm then it should be like as


Suggest me how can i get it.
I have allready posted it in JavaScript forum, but now i need to do it through PHP.
May 25 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 5,821
What I would do is store the page names in $_SESSION and then implode them or use a template:

Expand|Select|Wrap|Line Numbers
  1. $_SESSION['breadcrumbs'] += basename($_SERVER['PHP_SELF']);
  2. $template = '<a href="{file}">{file}</a>';
  3. foreach($_SESSION['breadcrumbs'] as $file)
  4.     echo str_replace('{file}', $file, $template);
May 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.