Jump to content

Internet Explorer+APache and PHP not working


gnawz

Recommended Posts

Hi

 

I have a PHP application for managing sales

 

My files in localhost work well when opened in Mozilla and Opera.

However, they do not work well in IE...

Some data is not displayed and the navigation gets messes. I keep getting "Page expired" when I browse through the applicatin.

 

Anyone knows why?

Some of my code is below.

 

After posting, the browser remains blank in IE but works in Mozilla and Opera. My clients prefer IE for the system


<?php
require_once '../../functions.php';

$action = isset($_GET['action']) ? $_GET['action'] : '';

switch ($action) 
{
case 'add' :
	addStock();
	break;

case 'modify' :
	modifyStock();
	break;

case 'delete' :
	deleteStock();
	break;

case 'deleteproduct' :
	deleteBrand();
	break;
default :
   
	echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\"> ";
}
/*Add Stock*/

function addStock()
{
    $ProductName = $_POST['txtProductName'];
$Quantity = $_POST['txtQuantity'];

		$sql   = "INSERT INTO inspirationstock (ProductName, Quantity, DateAddedStock) 
		VALUES ('$ProductName', '$Quantity', NOW())";
		dbQuery($sql);

	//$errorMessage = "Stock added successfully";
	echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\"> ";	
}
//Modify Stock
function modifyStock()
{
$StockID   = (int)$_POST['hidStockID'];	
 $Quantity = $_POST['txtQuantity'];

$sql   = "UPDATE inspirationstock SET Quantity = Quantity + '".$Quantity."', DateAddedStock = Now() WHERE StockID = '$StockID'";
dbQuery($sql);

$errorMessage = "Stock modified successfully";
echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\"> ";
}

function deleteStock()
{
if (isset($_GET['StockID']) && (int)$_GET['StockID'] > 0) {
	$StockID = (int)$_GET['StockID'];
} 
else 
{
	//header('Location: index.php');
	echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\"> ";
}

$sql = "UPDATE inspirationstock SET Quantity = '0' WHERE StockID = $StockID";
dbQuery($sql);
//$errorMessage = "Stock deleted successfully";
echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\">";
}

function deleteBrand()
{
$Brand = $_POST['sltBrand'];

$sql = "DELETE FROM inspirationstock WHERE ProductName = '$Brand'";
dbQuery($sql);

echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\">";	
}
?>

 

Whether I use

<? echo "<META HTTP-EQUIV=\"refresh\" content=\"; URL=index.php\">"; ?>

 

or

<?  header('Location: index.php'); ?>

 

it doesn't get back after posting.

 

However the post is successful because when I use the browser back button, I find the data.

 

 

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.