<? include "chksession_admin.php"; $id_edit=$_GET[id_edit]; include "connect.php"; $sql="SELECT * FROM tb_typebook WHERE id_typebook='$id_edit'"; $result=mysql_db_query($dbname,$sql); $rs=mysql_fetch_array($result); $id_type=$rs[id_typebook]; $typebook=$rs[typebook]; $rent_price=$rs[book_price_rent]; ?> <html> <head><title></title></head> <body> <? include "admin_menu.php"; ?> <form name="frm_booktype" action="admin_type_edit2.php" method="post" onSubmit="javascript:return fncSubmit();"> แก้ไขประเภทหนังสือ <input name="name_type" type="text" id="name_type" value="<?=$typebook?>" > ราคาค่าเช่า <input name="rent_price" type="text" value="<?=$rent_price?>" > บาท/วัน <input type="submit" name="submit" value="แก้ไข" > </form> </body> </html>
<? //include "chksession_admin.php"; $id_edit=$_POST[id_edit]; $name_type=$_POST[name_type]; $rent_price=$_POST[rent_price]; include "connect.php"; $sql="update tb_typebook set typebook='$name_type', book_price_rent='$rent_price' where id_typebook='$id_edit' "; $result=mysql_db_query($dbname,$sql); if ($result) { echo "แก้ไขหนังสือประเภท <font color=red>$name_type </font> ราคาเช่า <font color=red>$rent_price </font> บาท/วัน เรียบร้อยแล้ว"; echo "<meta http-equiv='refresh' content='5 ;url=admin_type.php'>[ <a href=admin_type.php>กลับหน้าหลัก</a> ] "; } else { echo "<meta http-equiv='refresh' content='5 ;url=admin_type_edit.php'>ไม่สามารถแก้ไขประเภทหนังสือได้"; } mysql_close(); ?>
Quote:<input type="hidden" name="id_type" value="<?=$id_type?>">
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง