lehel, it feels like I am just about stalking you now. I hope that you are not sick of this. I have tried playing around with the revised code that you gave. However when I loaded it into my cart_add.php the way it was, I got a parse error on the second "else"
include("../application.php");
$SESSION["cart"]->add($id, 1);
$SESSION["cart"]->cleanup();
$SESSION["cart"]->recalc_total();
if (! empty($HTTP_REFERER)) {
echo ("<script language=\"Javascript\">\n".
"doc1 = top.CartFrame.window.document;\n".
"doc1.open(\"shopping_cart.php\", \"CartFrame\", winsize);\n".
"self.location=$HTTP_REFERER;\n".
"</script>\n");
} else {
header("Location: $HTTP_REFERER");
} else { #### Parse Error Here
header("Location: $CFG->wwwroot");
}
?>
I tried removing this line too, however when you click on a "Add", it neither refreshes the central frame, nor does it update the cart.
I also tried using the header("Location: $HTTP_REFERER"); as the first statement, and then the lines you supplied as the next "else" argument, however that did not refresh it either. Once again I had to remove the header("Location: $CFG->wwwroot"); line or I would get a parse error.
include("../application.php");
$SESSION["cart"]->add($id, 1);
$SESSION["cart"]->cleanup();
$SESSION["cart"]->recalc_total();
if (! empty($HTTP_REFERER)) {
header("Location: $HTTP_REFERER");
} else {
echo ("<script language=\"Javascript\">\n".
"doc1 = top.CartFrame.window.document;\n".
"doc1.open(\"shopping_cart.php\", \"CartFrame\", winsize);\n".
"self.location=$HTTP_REFERER;\n".
"</script>\n");
}
?>
The only difference that I can see is that the example that I gave set the "java language script function" and then later called it.
Ie <area shape="rect" coords="362,340,448,361" ref="../cart_add.php?id=1"onClick=frmsubmit('recalc')>
Could that have anything to do with it still not refreshing. I have attched my index.php file that sets up all of my frames. Maybe this may shed some light. Is there any other information that I could give you to help??
**
index.php
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
<frame name="topFrame" scrolling="NO" noresize src="../templates/footer.php" >
<frameset cols="105," frameborder="NO" border="0" framespacing="0" rows="">
<frame name="leftFrame" scrolling="NO" noresize src="templates/Shopping_Menu.php">
<frameset rows="*,80" frameborder="NO" border="0" framespacing="0">
<frame name="ContentFrame" src="templates/catalog.php">
<frame name="CartFrame" scrolling="AUTO" src="templates/shopping_cart.php">
</frameset>
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</noframes>