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
|
<?php require("configure.php"); ?> <? $productsid = $_POST["productsid"]; $catid = $_POST["catid"];
if ($_FILES['image']['name'] <> '') { copy ($_FILES['image']['tmp_name'], "../product/".$productsid.$_FILES['image']['name']) or die ("Could not copy"); $image = $productsid.$_FILES['image']['name']; } else { $image = ""; }
$sql = "update products set productsid='$productsid', catid='$catid' "; if ($image <> '') $sql .= ", image='$image' "; $sql .= "where productsid=". $productsid ." "; //echo $sql; mysql_query($sql); mysql_close($dbh);
header("Location: productsindex.php?msg=Update Successful"); ?>
|