-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.php
28 lines (20 loc) · 1001 Bytes
/
edit.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
<?php
$gid=$_GET['gid'];
$host="localhost";
$username="root";
$password="";
$db_name="giftagift";
$tbl_name="products";
$db=mysqli_connect("$host", "$username", "$password")or die("cannot connect");
mysqli_select_db($db,"$db_name")or die("cannot select DB");
$sql="select * from $tbl_name where gid='$gid'";
$res=mysqli_query($db,$sql);
$row=mysqli_fetch_array($res);?>
<form enctype="multipart/form-data" method="post" action="editsave.php">
<label for="gname">Gift name</label><input type="text" name="gname" value="<?php echo $row['gname']; ?>">
<input type="number" name="gid" value="<?php echo $gid; ?>">
<input type="file" size="32" name="image_field" value="<?php echo $row['gimage']; ?>">
price<input type="number" name="price" value="<?php echo $row['price']; ?>" >
description<input type="text" name="desc" value="<?php echo $row['description']; ?>">
<input type="submit" name="Submit" value="upload">
</form>