Jump to content

Recommended Posts

Look at attached graphic to help.

----------

 

I'm looking for an easier way to make a "bread crumbs" type thing.

 

EXAMPLE:

 

about.php

haha.php

test.php

 

I was trying to be hopeful to make a page called "variables.php" or "youarehere.php".

On that page, I would put would put:

 

about.php -> "Home > About"

haha.php -> "Home > Haha"

test.php -> "Home > Test"

 

After that, I could include "variables.php" or whatever on the layout, and when that page comes up, it would go into variables.php and look for that page and give out what it says.

 

I might have to show you the whole layout code (header.php, footer.php) if you need it.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/110164-i-think-variables/
Share on other sites

sounds complicated. why not just check what page you're on and then include or echo out. But then again, maybe I'm not following you.

 

<?php

$page = $_SERVER['REQUEST_URI'];

 

switch($page){

case '/page1.php':

include('whatever');

echo 'whatever';

break;

case '/page2.php':

include('whatever');

echo 'whatever';

}

?>

Link to comment
https://forums.phpfreaks.com/topic/110164-i-think-variables/#findComment-565365
Share on other sites

Guest Xanza

the php switch is definitely the more practical way, but i like to use $_GET so I can customize my own urls.

 

<?php
/*
usage will be http://site.com/navagation.php?p=contact => contact.php
*/

$page = $_GET['p'];

if($page == 'home'){
include('index.php');
}

if($page == 'contact'){
include('contact.php');
}

if($page == 'about'){
include('about.php');
}

if($page == 'prices'){
include('prices.php');
}

if($page == 'quote'){
include('quote.php');
}

?>

 

but that won't help you for breadcrumbs, however this will: http://www.evolt.org/article/Breadcrumbs_for_PHP_Lovers/17/4455/

Link to comment
https://forums.phpfreaks.com/topic/110164-i-think-variables/#findComment-565379
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.