Jump to content

[SOLVED] having a post issue in IE


aebstract

Recommended Posts

I was thinking this was a basic html issue, but I think it's in to the php. (may be wrong) It seems whenever I click my button to process the script, it won't finish through in IE but does fine in Firefox. Note that I am using an image as the submit button. Here is the page:

 

<?php
header("Cache-control: private");
if(!isset($_SESSION["id"]))
{
header("Location: index.php?page=login");
exit;
}

echo '<pre>', print_r($_POST), '</pre>';

$product_cat = $_GET['product_cat'];
$checknum = 1;
$result = mysql_query("SELECT * FROM `p_products` WHERE category='$product_cat'") or DIE(mysql_error());
while($r = mysql_fetch_array($result))
{
  $id = $r['id'];
  $partnumber = $r['partnumber'];
  $partname = $r['partname'];
  $description = $r['description'];
  $price = $r['price'];
  $option1 = $r['option1'];
$specialid = $id;

$postname = image.$id;
$postsize = size.$id;

if (isset($_POST[$postname])) {
$error = 0;
if (isset($_POST['hideme'])) {
if (empty($_POST[$postsize])){
$error = 1;
$errormsg = "You must fill in a Pipe Size for $partname.";
} else {
$sizenum = $_POST[$postsize];
$specialid = $id.";".$sizenum;
}





}


if ($error == 1){
$errordisplay .= "<div id=\"error_box\">   $errormsg</div>";
} else {



$materialid = material.$id;
$finishid = finish.$id;
$material = $_POST[$materialid];
$finish = $_POST[$finishid];



if (isset($_SESSION['cart'][$id][$material][$finish])) {




  foreach ($_SESSION['cart'] as $id2 => $array2){

		if ($id2 == $id) {

		foreach ($array2 as $material2 => $array3){

		if ($material2 == $material) {

	foreach ($array3 as $finish2 => $array4){

		if ($finish2 == $finish) {

$newqty = $array4['qty'];
$newqty ++;
if (isset($array4['size'])) {
$_SESSION['cart'][$id][$material][$finish] = array(qty => $newqty, size => $array4['size']);
} else {
$_SESSION['cart'][$id][$material][$finish] = array(qty => $newqty);
}
header("Location: index.php?page=cart");
exit;

}
	}
	   }

  }
           }







    	}






} else {

if (isset($_POST['hideme'])) {
$setsize = size.$id;
$_SESSION['cart'][$id][$material][$finish] = array(qty => 1, size => $_POST[$setsize]);
} else {
$_SESSION['cart'][$id][$material][$finish] = array(qty => 1);
}
header("Location: index.php?page=cart");
exit;
}
}



}


if (!empty($option1)){
$clicker = "
<table>
<tr><td align=\"right\">
Material:
</td><td>
<select name=\"material$id\" style=\"background-color: #FFFFFF; border: solid 1px #000000; height: 20px; font-size: 10px;\">
<option value=\"Stainless\">Stainless Steel</option>
<option value=\"Mild\">Mild Steel</option>
</select>
</td></tr>
<tr><td align=\"right\">
Finish:
</td><td>
<select name=\"finish$id\" style=\"background-color: #FFFFFF; border: solid 1px #000000; height: 20px; font-size: 10px;\">
<option value=\"Uncoated\">Uncoated</option>
<option value=\"Black\">Black</option>
<option value=\"Other\">Other</option>
</select>
</td></tr>
<tr><td align=\"right\">
Pipe Size:
</td><td>
<input type=\"text\" size=\"4\" value=\"\" name=\"size$id\" style=\"background-color: #FFFFFF; border: solid 1px #000000; height: 20px; font-size: 10px;\" /><br />
</td></tr>
</table>
<div class=\"product_image\">
<input type=\"hidden\" name=\"hideme\" value=\"needsize\" />
<input type=\"image\" value=\"submit$id\" src=\"addtocart.jpg\" width=\"144\" height=\"34\" border=\"0\" alt=\"Add to Cart\" name=\"image$id\">
</div>";
} else {
$clicker = "
<table>
<tr><td align=\"right\">
Material:
</td><td>
<select name=\"material$id\" style=\"background-color: #FFFFFF; border: solid 1px #000000; height: 20px; font-size: 10px;\">
<option value=\"Stainless\">Stainless Steel</option>
<option value=\"Mild\">Mild Steel</option>
</select>
</td></tr>
<tr><td align=\"right\">
Finish:
</td><td>
<select name=\"finish$id\" style=\"background-color: #FFFFFF; border: solid 1px #000000; height: 20px; font-size: 10px;\">
<option value=\"Uncoated\">Uncoated</option>
<option value=\"Black\">Black</option>
<option value=\"Other\">Other</option>
</select><br />
</td></tr>
</table>
<div class=\"product_image\">
<input type=\"image\" value=\"submit$id\" src=\"addtocart.jpg\" width=\"144\" height=\"34\" border=\"0\" alt=\"Add to Cart\" name=\"image$id\">
</div>";
}

if( $odd = $checknum%2 ) {
	$content .= "
	<form action=\"index.php?page=product_page&product_cat=$product_cat\" method=\"post\" name=\"add_product$id\">
	<div class=\"product_left\">
	<div class=\"product_image\"><img src=\"products/$partnumber&#45;cart.jpg\" class=\"jkimagelarge\" title=\"products/$partnumber.jpg\" height=\"100\"/></div>
	<div class=\"product_info\">
	$partname
	<br />
	$partnumber
	<br />
	$$price
	<br /><br />

$clicker</div></div>
</form>";
} else {
	$content .= "
	<div class=\"product_right\">
	<form action=\"index.php?page=product_page&product_cat=$product_cat\" method=\"post\" name=\"add_product$id\">
	<div class=\"product_image\"><img src=\"products/$partnumber&#45;cart.jpg\" class=\"jkimagelarge\" title=\"products/$partnumber.jpg\" height=\"100\"/></div>
	<div class=\"product_info\">
	$partname
	<br />
	$partnumber
	<br />
	$$price
	<br /><br />
$clicker</div></div>
			<div class=\"productspace\"></div>

</form>";	}


$checknum ++;
}




?>

 

With the echo "$_POST" I get this displayed:

 

Array

(

    [material11] => Stainless

    [finish11] => Uncoated

    [size11] =>

    [hideme] => needsize

    [image11_x] => 36

    [image11_y] => 16

)

1

 

Then the page is just sitting there as if it hadn't changed a bit.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.