-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcertification.php
More file actions
53 lines (32 loc) · 1.05 KB
/
certification.php
File metadata and controls
53 lines (32 loc) · 1.05 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
<html>
<head>
<title>certification</title>
</head>
<body>
<form action="" method="POST" enctype="multipart/form-data">
signature:
<input type="file" name="tim" required/>
<input type="submit" name="submit" value="submit">
</form>
<?php
$dates=date('d-M-Y');
$conn=mysqli_connect('localhost','root','') or die (mysqli_error());
mysqli_Select_db($conn, "health");
if(isset($_POST['submit'])){
$uploadDir ='uploads/';
$fileName=$_FILES['tim']['name'];
$tmpName=$_FILES['tim']['tmp_name'];
$fileSize=$_FILES['tim']['size'];
$fileType=$_FILES['tim']['type'];
$filePath=$uploadDir.$fileName;
$result=move_uploaded_file($tmpName,$filePath);
$row="insert into certification (date,signature) values('$dates', '$filePath')"or (mysqli_error());
if(mysqli_query($conn,$row)){
echo '<script>window.alert("uploaded successfuly")</script>';
}else{
echo'<script>window.alert("upload signature")</script>';
}
}
?>
</body>
</html>