Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

clicking on ok button that appears when submitting form should return the add product page

$
0
0

i have a php page where i add products to my database table tbl_product on clicking on button add product a javascript pop up message is displayed with a message and an ok button...which code can be used so that when i click on the ok button it returns me the add_prod.php page to add another product

 

here is my addprod.php which is linked to the add_prod.php

 

<?php
 
if(isset($_POST['button'])){
 
include('db_connect.php');
 
$prod_name=$_POST['prod_name'];
$prod_brand=$_POST['prod_brand'];
$prod_desc=$_POST['prod_desc'];
$prod_price=$_POST['prod_price'];
$cat=$_POST['cat'];
$subcat=$_POST['subcat'];
$prod_w_c=$_POST['prod_w_c'];
$prod_photo=$_POST['prod_photo'];
 
$sql="INSERT INTO tbl_product(prod_name, prod_brand, prod_desc, prod_price, cat, subcat, prod_w_c, prod_photo) VALUES('$prod_name', '$prod_brand', '$prod_desc', '$prod_price', '$cat', '$subcat', '$prod_w_c', '$prod_photo')";
 
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
else 
{
}
?>
 
<script type="text/javascript">
    alert("Product successfully added...!!!");
    </script>
 
<?php
 
}
 
?>

Viewing all articles
Browse latest Browse all 13200

Trending Articles