-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompany.php
More file actions
57 lines (54 loc) · 2.07 KB
/
Copy pathcompany.php
File metadata and controls
57 lines (54 loc) · 2.07 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<body>
<hr>
<body style="background-color:skyblue"><h1 align="center">Company Details</h1>
<hr>
<center>
<form #action="companysubmit.php" method = "post">
<table>
<tr>
<td><br />ID       </td>
<td><br /><input type="text" name="ID" /><font color="RED" SIZE="2">*</font>            </td>
</tr>
<tr>
<td><br />Name       </td>
<td><br /><input type="text" name="Name" /><font color="RED" SIZE="2">*</font>            </td></tr>
<tr><td><br />Location       </td>
<td><br /><input type="text" name="Location" /><font color="RED" SIZE="2">*</font>           
</tr>
<tr>
<td><br /> Medicine Name       </td>
<td><br /><input type="text" name="MedicineName" /><font color="RED" SIZE="2">*</font>            </td></tr>
<tr>
<td><br />Batch No.       </td>
<td><br /><input type="text" name="BatchNo"><font color="RED" SIZE="2">*</font>            </td></tr>
<tr></td><td> <br />Date       </td>
<td> <br /><input type="text" name="ExpiryDate" /> <font color="RED" SIZE="2">*(yyyy-mm-dd)</font></td>
</tr>
</table>
<br /><input type="Submit" value="Submit"></center>
</form>
<?php
$con = mysql_connect("localhost","root","");
if(!$con)
{
die("Connection Failed");
}
if(!(mysql_select_db("employee_record", $con)))
{
die ("Database Not Selected");
}
if(isset($_POST['ID']) && isset($_POST['Name']) && isset($_POST['Location']) && isset($_POST['MedicineName']) && isset($_POST['BatchNo']) && isset($_POST['ExpiryDate']))
$query = "INSERT INTO COMPANY(ID,Name,Location,MedicineName,BatchNo,Date)
VALUES('$_POST[ID]','$_POST[Name]','$_POST[Location]','$_POST[MedicineName]','$_POST[BatchNo]','$_POST[ExpiryDate]')";
if (isset ($query))
$sql = mysql_query($query,$con);
if (isset ($sql))
if (!$sql)
{
echo "<br /> <font size='2' color='red'>*Required Fields are Mandotary</font>";
}
?>
</body>
</html>