-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
66 lines (47 loc) · 1.13 KB
/
test.php
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
58
59
60
61
62
63
64
65
66
<?php
/**
* Created by PhpStorm.
* User: Swastik
* Date: 2/3/2019
* Time: 9:39 PM
*/
include 'namespace.php';
use \helpers\Redirect;
use AccessLayer\DAL;
?>
<html>
<head>
<title>
Test
</title>
</head>
<body>
<form method = "post" enctype="multipart/form-data">
<label>title </label>
<input type="text" name="title">
<label>decription </label>
<input type="text" name="description">
<label>Upload image</label>
<input type="file" name="image" value="" >
<input type="hidden" name="id">
<button type="submit" name="submitButton">Submit</button>
</form>
<?php
$db = new DAL();
if(isset($_POST['submitButton'])){
$db->data = $_POST;
$db->button = 'submitButton';
$db->id = $_POST['id'];
$db->tableName = 'test';
$db->files = $_FILES;
$db->fileHolder = "image";
$db->imgPath = 'image/';
if(empty($db->id)){
$db->Save();
}
else
$db->update();
}
?>
</body>
</html>