Jump to content

Currency Selection - Delete Item headache


davey_b_

Recommended Posts

The code works fine for selecting between the currencies but here's the problem...

If I leave

echo "<script type='text/javascript'> window.location='".$_SERVER['HTTP_REFERER']."';</script>"; 

enabled then the page just continously reloads, if I comment it out then all works but you can't delete any products from the cart - or anywhere else for that matter!!!

 

Here's the code...

<?php /*currency section starts*/

	$currency_selected = "";

	session_register('SESS_currency_type');

	if(isset($_POST)) 
	{
		foreach($_POST as $k => $v) $_SESSION['SESS_currency_type'] = $k;		
		echo "<script type='text/javascript'> window.location='".$_SERVER['HTTP_REFERER']."';</script>"; // <-- problem line!!
	}
	else
	{
		if (!isset($_SESSION['SESS_currency_type']) OR $_SESSION['SESS_currency_type'] == "")
		{
			$_SESSION['SESS_currency_type']	= "1";
			$currency_type			= "1";
		}
	}
/*currency section ends*/ ?>

 

Does anyone know whats wrong??

Link to comment
https://forums.phpfreaks.com/topic/102508-currency-selection-delete-item-headache/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.