-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.php
More file actions
44 lines (44 loc) · 762 Bytes
/
Copy pathproject.php
File metadata and controls
44 lines (44 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html>
<?php
$servername='localhost';
$username='root';
$password='';
$db='project';
$id=$_POST['id'];
$name=$_POST['name'];
$brand=$_POST['brand'];
$sno=$_POST['sno'];
$mrp=$_POST['mrp'];
$quantity=$_POST['quantity'];
$conn=mysqli_connect($servername,$username,$password,$db);
if(!$conn)
{
die('Could not connect:'.mysqli_error());
}
else
{
$sql="insert into product values($id,'$name','$brand',$sno,$mrp,$quantity);";
$res=mysqli_query($conn,$sql) or mysqli_error($conn);
if($res==TRUE)
{
?>
<script>
var r=confirm('Product added');
if (r==true)
{
window.location.href="stock_insert.html";
}
</script>
<?php
}
else
{
?>
<script>
alert('Enter the correct details');
</script>
<?php
}
}
?>`
</html>