graham23s Posted February 15, 2008 Share Posted February 15, 2008 Hi Guys, This is weird, in my form when submitting to my online cart which is: <?php session_start(); include("inc/dbconnection.php"); include("inc/online.php"); include("inc/header.php"); include("inc/navigation.php"); ?> <?php // get the id // $categoryid = $_GET['id']; // query the db // $queryproduct = "SELECT * FROM `fcp_categories` WHERE `id`='$categoryid'"; $resultproduct = mysql_query($queryproduct) or die (mysql_error()); $row = mysql_fetch_array($resultproduct) or die (mysql_error()); // vars // $catname = $row['categoryname']; // set the rane // //$quantity = range(1,99); // get and display all the products associated with this cat // $queryproducts = "SELECT * FROM `fcp_products` WHERE `category_id`='$categoryid'"; $resultsproducts = mysql_query($queryproducts) or die (mysql_error()); // number of products // $numproducts = mysql_num_rows($resultsproducts); // standard header // print("<div class=\"subheader\"><div id=\"title\">Category > <span class=\"blue\">$catname</span></div>We have <b>$numproducts</b> products in this category for you to browse.</div>"); //--------------------------------------------// // need modulous to display them properly // $i = 0; // begin the table // print("<table class=\"products_table\" align=\"center\" width=\"100%\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\">"); // start the while loop // while ($rows = mysql_fetch_array($resultsproducts)) { $productid = $rows['id']; $product_name = $rows['product_name']; $product_description = $rows['product_description']; $product_price = $rows['product_price']; // display box for products // $display_box = "<form action=\"shoppingcart.php\" method=\"get\">\n"; $display_box .= "<div id=\"right\">\n"; $display_box .= "<div class=\"boxtop\">\n"; $display_box .= "</div>"; $display_box .= "<div class=\"box\">"; $display_box .= "<img src=\"images/image.gif\" alt=\"Product Image\" title=\"Product Image\" class=\"image\" />\n"; $display_box .= "<b>$product_name</b>"; $display_box .= "<br />"; $display_box .= "<br />"; $display_box .= "$product_description"; $display_box .= "<br />"; $display_box .= "<hr />"; $display_box .= "<input type=\"hidden\" name=\"productid\" value=\"$productid\" />"; $display_box .= "<input type=\"image\" src=\"images/cart_navy.gif\" border=\"0\" alt=\"Add this item to your shopping cart!\">"; $display_box .= "<hr />"; $display_box .= "Our Price <span class=\"price\">£$product_price</span>"; $display_box .= "<br />"; $display_box .= "<hr />"; $display_box .= "<b>Quantity:</b> "; $display_box .= "<select name=\"orderquantity\">"; $display_box .= "<option value=\"1\">1</option>"; $display_box .= "<option value=\"2\">2</option>"; $display_box .= "<option value=\"3\">3</option>"; $display_box .= "<option value=\"4\">4</option>"; $display_box .= "<option value=\"5\">5</option>"; $display_box .= "</select>"; $display_box .= "</div>\n"; $display_box .= "</div>\n"; $display_box .= "</div>\n"; $display_box .= "</form>\n"; if ($i==0) { print('<tr><td align="center">'.$display_box.'</td>'); } elseif ($i == 2) { print('<td align="center">'.$display_box.'</td></tr>'); } else { print('<td align="center">'.$display_box.'</td>'); } $i++; $i=$i % 2; // mod 2 gives you the remainder // } // end the while loop // // end the products tabel // print("</tr>"); print("</table>"); ?> <?php // include the footer // include("inc/footer.php"); ?> when this page is submitted i get this in the adress bar: shoppingcart.php?productid=4&orderquantity=5&x=34&y=15 this part: &x=34&y=15 shouldn't be there can anyone see the problem at all? thanks guys Graham Quote Link to comment Share on other sites More sharing options...
nogray Posted February 15, 2008 Share Posted February 15, 2008 input type="image" always passes in the x and y coordinate where the user clicked. Quote Link to comment Share on other sites More sharing options...
graham23s Posted February 15, 2008 Author Share Posted February 15, 2008 ah i see, it won't affect anything will it? nothing to worry about or change? cheers mate Graham Quote Link to comment Share on other sites More sharing options...
nogray Posted February 15, 2008 Share Posted February 15, 2008 no, it won't affect anything, just standard form stuff. Quote Link to comment Share on other sites More sharing options...
graham23s Posted February 15, 2008 Author Share Posted February 15, 2008 nice one thanks mate. Graham Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.