Vote count:
0
when i click on product list submit button catadd function auto run and both query run why this problem coming. why this function create problem
Active Deactive " /> } $catDesc = mysql_real_escape_string($_POST['catDesc']); $catStatus = $_POST['catStatus']; $catad = "INSERT INTO `ladyflossy_category`(`Cat_Name`, `Cat_Slug`, `Cat_Description`, `Cat_Status`) VALUES ('$catname','$catSlug','$catDesc','$catStatus') ";
if(mysql_query($catad)){ echo "ad Cat successfully"; } } } ?>
<form method="post" enctype="multipart/form-data" name="adproduct" id="adproduct">
<table width="100%" style="margin-top:20px;" border="0">
<tr>
<td>Product Id</td>
<td><input required type="text" name="ProductID" /></td>
</tr>
<tr>
<td width="200">Name:</td>
<td><input type="text" name="ProductName" required /></td>
</tr>
<tr>
<td width="200">Brand:</td>
<td><input type="text" name="ProductBrand" required /></td>
</tr>
<tr>
<td width="200">Original Price:</td>
<td><input type="text" name="Product_Org_Price" required /></td>
</tr>
<tr>
<td width="200">Price after Discount:</td>
<td><input type="text" name="Product_Dis_Price" required /></td>
</tr>
<tr>
<td width="200">Quantity:</td>
<td><input type="text" name="Product_Quantity" required /></td>
</tr>
<tr>
<td width="200">Category:</td>
<td><select name="Product_Category" id="Product_Category">
<?php GetCat() ?>
</select>
</td>
</tr><tr><td width="200"></td>
<td>
<div id="msg"></div>
</td>
</tr>
<td width="200">Color:</td>
<td>
<input type="checkbox" name="Product_Color[]" value="Red" /> Red <input type="checkbox" name="Product_Color[]" value="Black" /> Black <input type="checkbox" name="Product_Color[]" value="Green" /> Green
</td>
</tr>
<tr>
<td width="200">Size:</td>
<td>
<input type="checkbox" name="Product_Size[]" value="Medium" /> Medium <input type="checkbox" name="Product_Size[]" value="Small" /> Small <input type="checkbox"name="Product_Size[]" value="Large" /> Large <input type="checkbox" name="Product_Size[]" value="X L" /> X-L
</td>
</tr>
<tr>
<td>Is Active</td>
<td><select name="Product_Activity" >
<option value="Active">Yes</option>
<option value="Unactive">No</option>
</select></td>
</tr>
<tr>
<td valign="top">Description:</td>
<td><textarea required name="Product_Description" cols="20" rows="5"></textarea></td>
</tr>
<tr>
<td>Image</td>
<td><input required type="file" name="Product_Image" /></td>
</tr>
<!--<tr>
<td>Page Title:</td>
<td><input required type="text" name="title" /></td>
</tr>
<tr>
<td>Meta Keywords:</td>
<td><textarea required name="" cols="20" rows="5"></textarea></td>
</tr>
<tr>
<td>Meta Description:</td>
<td><textarea required name="" cols="20" rows="5"></textarea></td>
</tr>
<tr>
<td>Include in Navigation Menu</td>
<td><select name="nav-menu">
<option>Yes</option>
<option>No</option>
</select></td>
</tr>-->
<tr>
<td><input class="button" type="submit" name="save" value="save" /></td>
<td><input class="button" type="reset" name="reset" value="reset" /></td>
</tr>
</table>
</form>
<?php
if(isset($_POST['save'])){
$ProductID = $_POST['ProductID'];
$ProductName = $_POST['ProductName'];
$ProductBrand = $_POST['ProductBrand'];
$Product_Org_Price = $_POST['Product_Org_Price'];
$Product_Dis_Price = $_POST['Product_Dis_Price'];
$Product_Quantity = $_POST['Product_Quantity'];
$Product_Category = $_POST['Product_Category'];
$Product_SubCategory = $_POST['Product_SubCategory'];
$Product_Color = implode(',',$_POST['Product_Color']);
$Product_Size = implode(',',$_POST['Product_Size']);
$Product_Description = $_POST['Product_Description'];
$Product_Image = $_POST['Product_Image'];
$Product_Activity = $_POST['Product_Activity'];
echo $ProductDetail_Sql="INSERT INTO `ladyflossy_productsdetails`(`Product_ID`, `Product_Name`, `Product_Brand`, `Product_Original_Price`, `Product_Discount_Price`, `Product_Quantity`, `Product_Colors`, `Product_Size`, `Product_Description`, `Product_Images`, `Product_Status`, `Cat_ID`, `Subcat_ID`) VALUES ('$ProductID','$ProductName','$ProductBrand','$Product_Org_Price','$Product_Dis_Price','$Product_Quantity','$Product_Color','$Product_Size','$Product_Description','$Product_Image','$Product_Activity','$Product_Category','$Product_SubCategory')";
$ProductDetail_Query = mysql_query($ProductDetail_Sql);
if($ProductDetail_Query){
echo ' <tr>
<td> </td>
<td>Product Listed Successfully</td>
</tr>';
}
else{
echo 'Some Thing Going Wrong';
}
}
?>
when i click on product list submit button catadd function auto run and both query run why this problem coming. why this function create problem
asked 17 secs ago
Aucun commentaire:
Enregistrer un commentaire