hi m write a program to get the values from the form and storing them in database but its giving me error of undefined index for all variables . my code is
<?php
session_start();
$con=mysql_connect("localhost","root","");
mysql_select_db("pras2");
$name=($_POST['name']);
$type=($_POST['type']);
$color=($_POST['color']);
$unit_price=($_POST['price']);
$size=($_POST['size']);
$id=($_POST['id']);
$query="INSERT INTO product (product_id, product_name, type, color, unit_price, size) VALUES ( '$id', '$name', '$type', '$color', '$unit_price', '$size')";
$result=mysql_query($query);
if ($result){
echo " product has been added in database successfully";
}
else
{
echo "Your product cannot be added";
}
?>