osCommerce – Odd checkout lane fix

I moved an osCommerce store over from another host. When I ported it over I couldn’t add any products to the checkout lane. When I did, it would sent me to the checkout lane with the product in it, then immediately redirect me back to the home page. If I then clicked view cart, the cart was empty. I resolved the problem by remarking this code out, which seemed to be causing the problem.

The file was /shopping_cart.php on line 238. If anyone can shed some more light on to what the issue was I would love to hear it. The good news is I fixed the problem.


<script type="text/javascript" language="JavaScript">// <![CDATA[
/**
var reloaded = false;
var loc=""+document.location;
loc = loc.indexOf("?reloaded=")!=-1?loc.substring(loc.indexOf("?reloaded=")+10,loc.length):"";
loc = loc.indexOf("&")!=-1?loc.substring(0,loc.indexOf("&")):loc;
reloaded = loc!=""?(loc=="true"):reloaded;
function reloadOnceOnly() {
//alert('reload?' + reloaded); // silo88
if (!reloaded)
window.location.replace(window.location+"?reloaded=true");
}
reloadOnceOnly();
*/
// ]]></script>