Topic: osCommerce problem

Sorry for placing such post on this forum, but I am reallu desparate to find the solution to my problem. I did not receive any help on osCommerce forum http://forums.oscommerce.com/index.php? … 76&hl= sad On the other hand I have always received help from you, that's why I decided myself to write here.

I tried to install a contribution on my index page which allows to place on it some of the boxes from the shop. I put the following code on http://www.bulgaricus.com/index1.php

<?php
$cwd=getcwd();
chdir('/home/bulgaricus/public_html/sklep/'); 
include('includes/application_top.php');
ob_start();
include(DIR_WS_BOXES.'specials.php');
$sbox=ob_get_contents();
ob_clean();
include(DIR_WS_BOXES.'whats_new.php');
$wbox=ob_get_contents();
ob_end_clean();
$sbox=str_replace("src=\"images", "src=\"http://www.bulgaricus.com/sklep/images",$sbox);
$wbox=str_replace("src=\"images", "src=\"http://www.bulgaricus.com/sklep/images",$wbox);
chdir($cwd);
?>

<html><head>
<link rel="stylesheet" type="text/css" href="http://www.bulgaricus.com/sklep/stylesheet.css" /> 
</head>
<body><center>
<table border="0" width="120" cellspacing="0" cellpadding="0">
<?php 
echo $sbox;
?>
</table>
<table border="0" width="120" cellspacing="0" cellpadding="0">
<?php 
echo $wbox;
?>
</table></center></body></html>

Everything works great except that when I click a link from my index page to the shop it does not work. The explorer shows a totally blank screen.

On the other side if I erase 'www' from that link, it works. Normally the shop works with the 'www' in the link. What is wrong?

I will be very grateful for your help. Thanks in advance!

Re: osCommerce problem

The blank page usually means a PHP error occurred, but that error reporting is somehow disabled. Are you running this on your own server?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: osCommerce problem

No, I am buying a web hosting from a provider (www.konta.pl).

Re: osCommerce problem

Yes, it is very strange, because if you click
http://www.bulgaricus.com/sklep/index.php it is working, but if you click
first www.bulgaricus.com/index1.php than
http://www.bulgaricus.com/sklep/index.php will not work, but
http://bulgaricus.com/sklep/index.php will work. That is strange and I am
really lost sad

Re: osCommerce problem

I have got the solution (partly). The problem was caused by the existence of two scripts on the index page which were creating cookies. One of the scripts is those of the osCommerce shop, the other is of PunBB showing titles of last posts:

<?php
ini_set('include_path', ini_get('include_path').':./forum');

@include 'config.php';

if (!defined('PUN'))
    exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');

define('PUN_DONT_UPDATE_COOKIE', 1);    // This will make sure that the forum doesn't set a new cookie for the visiting user
require 'include/common.php';

$result = $db->query('SELECT id, subject FROM '.$db->prefix.'topics WHERE moved_to IS NULL ORDER BY last_post DESC LIMIT 5') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

while ($cur_topic = $db->fetch_assoc($result))
{
    if ($options['censoring'] == '1')
        $cur_topic['subject'] = censor_words($cur_topic['subject']);

    if (strlen($cur_topic['subject']) > 30)
        $cur_topic['subject'] = trim(substr($cur_topic['subject'], 0, 24)).' ...';

    echo "\t\t\t\t\t\t\t".'<b>·</b> <font size=1><a href="http://www.bulgaricus.com/forum/viewtopic.php?id='.$cur_topic['id'].'">'.htmlspecialchars($cur_topic['subject']).'</a></font><br>'."\n";
}
 ?>

Do you know how I can make those two scripts run on my index page?