473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

New to PHP help with breadcrumbs

Hi there So far I have designed a simple template file in PHP:

<?php if(!$page) $page="home";
if(file_exists("/my root/public_html/progress/$page.html")) {
include("/my root/public_html/progress/$page.html"); } else {
include("/my root/public_html/progress/404.html"); } ?>

Where I want the breadcrumbs, i have a: <?php print($location); ?>

and the content below breadcrumbs is: <?php print($content); ?>

My example $page looks like this:

<?php $location=" <a href=\"index.php?page=home\">HOME</a&nbsp »
&nbsp <a href=\"index.php?page=\contact">CONTACT US</a>";
$content='<table border="0" cellspacing="0" cellpadding="0"
dwcopytype="CopyTableCell">
<td width="542" valign="top"><img src="img/mm_spacer.gif" alt=""
width="305" height="1" border="0" /><br />
&nbsp; <br />
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td height="35" valign="top" class="pageName">Contact Us </
td>
</tr>
<tr valign="top">
<td height="371" class="bodyText"><p>Your email has been
received and will be answered shortly.</p>
<p align="left"><img src="img/emailfire.gif" width="105"
height="129" /</p></td>
</tr>
</table>
<br />
&nbsp;<br /> <img src="img/mm_spacer.gif" alt="" width="50"
height="1" border="0" /></td>
</table>'; ?>

Some pages dont work cause i use a ' symbol in the content.

Is there a better way to do breadcrumbs?

Thanks
Tom

Feb 11 '07 #1
5 2181
You can escape the single quote (\'). But you may want to just put the
content outside the script tags instead of putting it in a variable.

Here's a breadcrumb function that uses the file system to get path
info:

http://www.evolt.org/article/Breadcr...overs/17/4455/

On Feb 11, 12:43 pm, "tommylux" <tommy...@gmail.comwrote:
Hi there So far I have designed a simple template file in PHP:

<?php if(!$page) $page="home";
if(file_exists("/my root/public_html/progress/$page.html")) {
include("/my root/public_html/progress/$page.html"); } else {
include("/my root/public_html/progress/404.html"); } ?>

Where I want the breadcrumbs, i have a: <?php print($location); ?>

and the content below breadcrumbs is: <?php print($content); ?>

My example $page looks like this:

<?php $location=" <a href=\"index.php?page=home\">HOME</a&nbsp »
&nbsp <a href=\"index.php?page=\contact">CONTACT US</a>";
$content='<table border="0" cellspacing="0" cellpadding="0"
dwcopytype="CopyTableCell">
<td width="542" valign="top"><img src="img/mm_spacer.gif" alt=""
width="305" height="1" border="0" /><br />
&nbsp; <br />
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td height="35" valign="top" class="pageName">Contact Us </
td>
</tr>
<tr valign="top">
<td height="371" class="bodyText"><p>Your email has been
received and will be answered shortly.</p>
<p align="left"><img src="img/emailfire.gif" width="105"
height="129" /</p></td>
</tr>
</table>
<br />
&nbsp;<br / <img src="img/mm_spacer.gif" alt="" width="50"
height="1" border="0" /></td>
</table>'; ?>

Some pages dont work cause i use a ' symbol in the content.

Is there a better way to do breadcrumbs?

Thanks
Tom

Feb 11 '07 #2
In my template page, i am currently trying to put the PHP Print before
include, and it doesnt work. Is there a PHP Command to open or pass
the php file without including it on the page?

<?php print($breadcrumb); ?>
<?php include("/home/embers-o/public_html/progress/breadcrumb/
content.php"); ?>

Thanks

Tom
On Feb 11, 9:02 pm, "petersprc" <peters...@gmail.comwrote:
You can escape the single quote (\'). But you may want to just put the
content outside the script tags instead of putting it in a variable.

Here's a breadcrumb function that uses the file system to get path
info:

http://www.evolt.org/article/Breadcr...overs/17/4455/

On Feb 11, 12:43 pm, "tommylux" <tommy...@gmail.comwrote:
Hi there So far I have designed a simple template file in PHP:
<?php if(!$page) $page="home";
if(file_exists("/my root/public_html/progress/$page.html")) {
include("/my root/public_html/progress/$page.html"); } else {
include("/my root/public_html/progress/404.html"); } ?>
Where I want the breadcrumbs, i have a: <?php print($location); ?>
and the content below breadcrumbs is: <?php print($content); ?>
My example $page looks like this:
<?php $location=" <a href=\"index.php?page=home\">HOME</a&nbsp »
&nbsp <a href=\"index.php?page=\contact">CONTACT US</a>";
$content='<table border="0" cellspacing="0" cellpadding="0"
dwcopytype="CopyTableCell">
<td width="542" valign="top"><img src="img/mm_spacer.gif" alt=""
width="305" height="1" border="0" /><br />
&nbsp; <br />
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td height="35" valign="top" class="pageName">Contact Us </
td>
</tr>
<tr valign="top">
<td height="371" class="bodyText"><p>Your email has been
received and will be answered shortly.</p>
<p align="left"><img src="img/emailfire.gif" width="105"
height="129" /</p></td>
</tr>
</table>
<br />
&nbsp;<br / <img src="img/mm_spacer.gif" alt="" width="50"
height="1" border="0" /></td>
</table>'; ?>
Some pages dont work cause i use a ' symbol in the content.
Is there a better way to do breadcrumbs?
Thanks
Tom

Feb 11 '07 #3
One way would be to paste the contents of content.php into the calling
script:

<? echo $bread; ?>

[...content...]

Are you getting an error currently?

Feb 12 '07 #4
peter, very new to php so forgive me that i dont understand fully of
your last post.

so I want the breadcrumbs with hyperlinks at the top of the page
before i include the content.php. Template page:
=========
Normal HTML template...
<?php print($breadcrumb); ?>
Normal HTML template...
<?php include("/home/embers-o/public_html/progress/breadcrumb/
content.php"); ?>
=========

My content php would look like:

=========
<?php $breadcrumb= "<a href=\"index.php?page=home\">HOME</a&nbsp »
&nbsp <a href=\"index.php?page=contact\">CONTACT US</a>"; ?>
Normal HTML Content...
=========

It works when i put the: $breadcrumb after the content but not before.

Not sure how to implement the echo in your suggestion. maybe in the
template page:

please help

Tom

On Feb 12, 12:05 am, "petersprc" <peters...@gmail.comwrote:
One way would be to paste the contents of content.php into the calling
script:

<? echo $bread; ?>

[...content...]

Are you getting an error currently?

Feb 12 '07 #5
Your page could look like this:

<?
require('pre.php')
$trail[] = array('home', 'contact');
?>
Stuff
<? require('top.php') ?>
Content

In top.php, you could print out the trail. You can also just use a
string instead ($trail = "<a>...|<a>...").

Feb 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
14
by: Eric Lindsay | last post by:
I've seen a page using display, and especially display table that did some neat things with boxes, but basically it only worked with Mozilla browsers. Fell over fairly badly with Opera and Safari...
8
by: RCS | last post by:
All, OK, so I'm working on a template for our new ASP.NET applications. Part of this, includes using the new menu and breadcrumbs control in ASP.NET 2.0 (I'm using beta 2). I put the...
5
by: Red | last post by:
Hi, Can someone give me some pointers on how to approach creating multi level category navigation for a website? Take ebay for example. No matter where you are, you have a navigation bar...
9
by: crescent_au | last post by:
Hi everybody, I want to create dynamic breadcrumbs for a site I am developing. I just want to get some views about the algorithm of breadcrumbs. The way I look at it is the concept of parent/...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
1
by: info | last post by:
If you make the Breadcrumbs control use the site map, is there a way to not show certain things that can be visible in the site map, but not in the main navidation menu? I ask, as I have an item...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.