Wrox Programmer Forums
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 29th, 2007, 07:21 AM
Registered User
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default browsing path

hi all,
 i want to show the browsig path on my site, like it is shown in p2p.wrox.com as u can see above when we are on new topic page it is displayed on top like this : P2P Forum > PHP/MySQL > PHP How-To > New Topic

i want to do same thing on my site using PHP. kindly give me idea how to do this .

Thanx..
 
Old June 6th, 2007, 05:30 AM
Authorized User
 
Join Date: Mar 2005
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to pritz Send a message via Yahoo to pritz
Default

Hellow,

try a demo
index.php
<?php
session_start();
$_SESSION['page']='home';
echo 'Currently on page: '.$_SESSION['page'];
echo "<br>i am on home page";
?>
<a href="first.php">First</a>
<a href="second.php">Second</a>
<a href="third.php">Third</a>

first.php
<?php
session_start();
if(isset($_SESSION['page']))
{
    if($_SESSION['page']=='home')
        $_SESSION['page'].='-> first';

}
echo 'Currently on page: '.$_SESSION['page'];
echo "<br>you are on first page";
?>
<a href="fchild.php">First child</a>


second.php
<?php
session_start();
if(isset($_SESSION['page']))
{
    if($_SESSION['page']=='home')
        $_SESSION['page'].='-> second';

}
echo 'Currently on page: '.$_SESSION['page'];
echo "<br>you are on second page";
?>

third.php
<?php
session_start();
if(isset($_SESSION['page']))
{
    if($_SESSION['page']=='home')
        $_SESSION['page'].='-> third';

}
echo 'Currently on page: '.$_SESSION['page'];
echo "<br/>you are on third page";
?>
fchild.php
<?php
session_start();
if(isset($_SESSION['page']))
{
    if($_SESSION['page']=='home-> first')
        $_SESSION['page'].='-> first child';

}
echo 'Currently on page: '.$_SESSION['page'];
echo "<br/>you are on first's child page";

?>

This is a very basic demo.usually what you are trying to achieve is caleld breadcrumps and it show which dir you are trying to fetch .a good link to share is below

http://www.zend.com/zend/spotlight/breadcrumb28.php







Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with path for loading Pics (app.path) Tabbasum Beginning VB 6 2 November 15th, 2007 04:57 AM
Implementing the all-path shortest path problem bitwords XSLT 1 December 6th, 2006 11:37 AM
Browsing for a file jroxit Other Programming Languages 1 January 23rd, 2006 01:29 PM
Browsing away from page mattastic Javascript How-To 1 February 8th, 2005 09:22 PM
Re: Browsing to Data Source dazzer General .NET 0 March 17th, 2004 08:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.