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?

kamill
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

home->about_us.htm

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

home->about_us.htm->contact_us.htm

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


pbmods
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);
  5.  
May 25 '07 #2

Post your reply

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