-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
29 lines (29 loc) · 941 Bytes
/
Copy pathaction.php
File metadata and controls
29 lines (29 loc) · 941 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
<?php
//action.php
include 'crud.php';
$object = new Crud();
if(isset($_POST["action"]))
{
if($_POST["action"] == "Load")
{
echo $object->get_data_in_table("SELECT * FROM users ORDER BY id DESC");
}
if($_POST["action"] == "Insert")
{
$first_name = mysqli_real_escape_string($object->connect, $_POST["first_name"]);
$last_name = mysqli_real_escape_string($object->connect, $_POST["last_name"]);
$image = $object->upload_file($_FILES["user_image"]);
$query = "
INSERT INTO users
(name, user_name, password)
VALUES ('".$first_name."', '".$last_name."', '".$image."')
";
$object->execute_query($query);
echo 'Data Inserted';
}
if($_POST["action"] == "delete")
{
echo 'DATA DELETE HERE !!';
}
}
?>