-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform_update.php
More file actions
36 lines (36 loc) · 1.05 KB
/
form_update.php
File metadata and controls
36 lines (36 loc) · 1.05 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<!-- Lấy lại những nội dung bài đăng trước đó in vòa form để sửa -->
<?php
$ma = $_GET['ma'];
require 'connect.php';
$sql = "select * from tin_tuc
where ma = $ma";
$ket_qua = mysqli_query($ket_noi,$sql);
$tin_tuc = mysqli_fetch_array($ket_qua);
?>
<!--Giao diện Form để sửa nội dung -->
<form method="post" action="process_update.php">
<!-- input này để đẩy cái mã theo form nếu nhấn sửa -->
<input type="hidden" name="ma" value="<?php echo $ma ?>">
Tiêu đề
<input type="text" name="tieu_de" value="<?php echo $tin_tuc['tieu_de'] ?>">
<br>
Nội dung
<textarea name="noi_dung"><?php echo $tin_tuc['noi_dung'] ?>
</textarea>
<br>
Link ảnh
<input type="text" name="anh" value=" <?php echo $tin_tuc['anh'] ?>">
<br>
<button>Sửa</button>
</form>
<?php mysqli_close($ket_noi)?>
</body>
</html>