-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate2.php
More file actions
44 lines (33 loc) · 1.65 KB
/
Copy pathupdate2.php
File metadata and controls
44 lines (33 loc) · 1.65 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
<?php
include("connection.php");
if(isset($_POST['update']))
{
$name = mysqli_real_escape_string($con,$_POST['name']);
$id = mysqli_real_escape_string($con,$_POST['id']);
$short = mysqli_real_escape_string($con,$_POST['short']);
$feat = mysqli_real_escape_string($con,$_POST['feat']);
$class = mysqli_real_escape_string($con,$_POST['class']);
$pdf = mysqli_real_escape_string($con,$_POST['pdf']);
$hash = "#";
$mod = "portfolioModal";
$modalid = $mod.$id;
$modal = $hash.$modalid;
// $img_name = $_FILES["img"]["name"]; // get the name of the uploaded image file
// $img_tmp_name = $_FILES["img"]["tmp_name"]; // get the temporary name of the uploaded image file
// // Define the target directory for the uploaded image
// $target_dir = "assets/img/products/";
// $target_file = $target_dir . basename($img_name); // create the full path of the target file
// move_uploaded_file($img_tmp_name, $target_file);
$sql = "update prod_tab set name='$name',short='$short',class='$class',feat='$feat',pdf='$pdf',modal='$modal',modid= '$modalid' WHERE id='$id'";
if ($con->query($sql) === TRUE) {
header('Location: http://localhost/NextTech/manage_pro.php');
} else {
echo "Error: " . $sql . "<br>" . $con->error;
}
// if(mysqli_query($con,$sql)){
// echo "Data inserted...";
// header('Location: http://localhost/NextTech/manage_pro.php');
// }else {
// echo "Data not inserted...!!!";
// }
}