PDA

View Full Version : breadcrumb error because of headers


wolfdogg
08-30-2006, 01:40 PM
Hello, my app works fine without this entry of the breadcrumb include. i was wondering if i could just relocate the breadcrumb include <?php require_once($_SERVER['DOCUMENT_ROOT']."/main/include/breadcrumb2.php"); ?>to the top, assign a variable to it, then just call the variable where iwant the breadcrumbs to display. is this what i need to do to solve this problem?

heres the code for the page up to the breadcrumbs entry, followed by its error messages.

<?php
// is the page being accessed through an HTTPS connection?
if ( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on' )
$is_https = false;
else
$is_https = true;
// visiting a sensitive page?
if (isset($_GET['RegisterCustomer']) ||
isset($_GET['ChangeDetails']) ||
isset($_GET['AddOrChangeAddress']) ||
isset($_GET['AddOrChangeCreditCard']) ||
isset($_POST['Login']))
$is_sensitive_page = true;
else
$is_sensitive_page = false;
// use HTTPS when accessing sensitive pages
if ($is_sensitive_page && $is_https==false)
{
header ('Location: https://' . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI']);
die();
}
// don't use HTTPS for nonsensitive pages
if (!$is_sensitive_page && $is_https == true)
{
header ('Location: http://' . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI']);
die();
}
// Load Smarty library and config files
require_once 'include/app_top.php';
require_once SITE_ROOT . '/main/shop/business_objects/bo_shopping_cart.php';
require_once SITE_ROOT . '/main/shop/business_objects/bo_customer.php';
require_once SITE_ROOT . '/main/shop/business_objects/bo_amazon.php';

/* if not visiting a product page, save the link to the current page
in the PageLink session variable; it will be used to create the
Continue Shopping link in the product details page and the links
to product details pages */
if (!isset($_GET['ProductID']) && !isset($_GET['CartAction']))
$_SESSION['PageLink'] = "http://" . $_SERVER['SERVER_NAME'] .
":" . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];

// Load Business Tier
require_once SITE_ROOT . '/main/shop/business_objects/bo_catalog.php';?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="/main/css/main.css" rel="stylesheet" type="text/css">
<title>title</title>

<style type="text/css">
<!--
@import url("../css/home.css");
-->
</style>

</head>
<body>
<div id="header">
<div id="banner">
</div><!--End Banner Div -->
<?php require_once($_SERVER['DOCUMENT_ROOT']."/main/include/h_topNavs.php"); ?><div class="clear"><!-- -->
</div><!--End IMPORTANT clear boxes Div -->
</div><!--end Header Div -->
<div id="pageBox">
<div id="titleBar">
<span id="breadcrumb"><?php require_once($_SERVER['DOCUMENT_ROOT']."/main/include/breadcrumb2.php"); ?>
</span><!--end Breadcrumbs -->

error message......
.........................

Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

ERRNO: 8
TEXT: Undefined index: home
LOCATION: /home/c4sale/public_html/main/include/class.breadcrumb.inc.php, line 304, at August 30, 2006, 1:22 pm
Showing backtrace:
breadcrumb.show_breadcrumb() # line 15, file: /home/c4sale/public_html/main/include/breadcrumb2.php
require_once("/home/c4sale/public_html/main/include/breadcrumb2.php") # line 71, file: /home/c4sale/public_html/main/shop/index.php

Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

ERRNO: 8
TEXT: Undefined variable: dir
LOCATION: /home/c4sale/public_html/main/include/class.breadcrumb.inc.php, line 311, at August 30, 2006, 1:22 pm
Showing backtrace:
breadcrumb.show_breadcrumb() # line 15, file: /home/c4sale/public_html/main/include/breadcrumb2.php
require_once("/home/c4sale/public_html/main/include/breadcrumb2.php") # line 71, file: /home/c4sale/public_html/main/shop/index.php

Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

ERRNO: 8
TEXT: Undefined variable: showLink
LOCATION: /home/c4sale/public_html/main/include/class.breadcrumb.inc.php, line 357, at August 30, 2006, 1:22 pm
Showing backtrace:
breadcrumb.show_breadcrumb() # line 15, file: /home/c4sale/public_html/main/include/breadcrumb2.php
require_once("/home/c4sale/public_html/main/include/breadcrumb2.php") # line 71, file: /home/c4sale/public_html/main/shop/index.php

Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

ERRNO: 8
TEXT: Undefined variable: showLink
LOCATION: /home/c4sale/public_html/main/include/class.breadcrumb.inc.php, line 360, at August 30, 2006, 1:22 pm
Showing backtrace:
breadcrumb.show_breadcrumb() # line 15, file: /home/c4sale/public_html/main/include/breadcrumb2.php
require_once("/home/c4sale/public_html/main/include/breadcrumb2.php") # line 71, file: /home/c4sale/public_html/main/shop/index.php

Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

MIDDLE DELETED-was more errno:8's------------------------------------

ERRNO: 8
TEXT: Undefined variable: target
LOCATION: /home/c4sale/public_html/main/include/class.breadcrumb.inc.php, line 361, at August 30, 2006, 1:22 pm
Showing backtrace:
breadcrumb.show_breadcrumb() # line 15, file: /home/c4sale/public_html/main/include/breadcrumb2.php
require_once("/home/c4sale/public_html/main/include/breadcrumb2.php") # line 71, file: /home/c4sale/public_html/main/shop/index.php

Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

ERRNO: 8
TEXT: Undefined property: breadcrumb::$fileNametoTitle
LOCATION: /home/c4sale/public_html/main/include/class.breadcrumb.inc.php, line 369, at August 30, 2006, 1:22 pm
Showing backtrace:
breadcrumb.show_breadcrumb() # line 15, file: /home/c4sale/public_html/main/include/breadcrumb2.php
require_once("/home/c4sale/public_html/main/include/breadcrumb2.php") # line 71, file: /home/c4sale/public_html/main/shop/index.php

Home |> Shop
4-Sale.com - Page Title

notice the 2 above lines are the begenning of a normal working page that displays after teh error messages, and notice it looks like a working breadcrumb.

wolfdogg
08-30-2006, 05:18 PM
i know this error looks big guys, but its just from one single line include.
isnt it blatantly obvious to you (experienced) PHP heads that i am going about this the wrong way? like shouldnt i be using a variable instead or something? please go easy on me with the terminology, because im still relatively new at php
thanks in advance

erisco
08-30-2006, 05:25 PM
Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22
Is from a file that does not exist. I can't see where you are using the error_log function, it is probably on another file, but it could be causing cascading errors.

wolfdogg
09-11-2006, 03:43 PM
you knwo, to date, this breadcrumb caller breaks my app in many instances. i wonder if i should just choose another breadcrumb script.

erisco
09-11-2006, 03:48 PM
if it is causing errors, it isn't because the script is bad, it is because you have not configured it to work in your specific case. There will always be modifying here and there.

If you want to back out and look for a different breadcrumb system, go for it. your call.

wolfdogg
09-13-2006, 02:04 PM
no, you make sense, i really dont, im glad you stated it that way, ill just have to work harder at it.... i will have to figure out how to properly integrate it.

scoutt
09-14-2006, 08:28 AM
actually the breadcrumb is not the one erroring out. lets run through the errors


Warning: error_log(/main/4-sale_errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/c4sale/public_html/main/shop/include/tss_error_handler.php on line 22

that error means that tss_error_handler.php script doesn't have permissions to make a file or save a file to folder "main". make sure "main" has writable permissions. also it mybe looking for that file but it is not there. could just create one and upload it there and set teh permissions to that folder.

the other errors can be turned off in the php.ini file. They are just notices and not errors. You can troubleshoot the problems by opening include/class.breadcrumb.inc.php and going to eachline the error is on and fix the warning. but if you did not write this you may just turn the notices off or tell the makers of the script. but I bet that once you fix the file missing error it may not show the others.

wolfdogg
09-15-2006, 01:29 AM
Thanks for this scoutt, by the way!
I think what the problem was that i had misconfigured the error.log file in my config file. i will have to false the line for controlling the write to error log, for the time being. .... hehe. i dont really need the error log, i debug them on the spot usually until going live.