0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
webboard
/
admin
/
[
Home
]
File: delcomt.php
<? session_start(); if($user==""){ $message = "กรุณา Login ก่อน."; $url = "../../admin/index.php"; include("../../admin/alert.php"); exit; } ?> <title>-=- ลบข้อมูลเรียบร้อยแล้ว -=-</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="#FFFFFF"> <? require("../config.inc.php"); #ใช่แล้วลบได้เลยลบ Comment ก่อนเลยและลบรูปออกจากระบบด้วย mysql_connect($host,$user_db,$passwd_db); mysql_query ("SET NAMES 'tis620'"); $sql_c = "select * from webboard_ans where QuestionNo='$No' and No_com='$comt'"; $c_query = mysql_db_query($dbname,$sql_c) or die ("ไม่สามารถสั่งให้ database ทำงานได้ในขณะนี้"); while( $c_arr = mysql_fetch_row( $c_query ) ) { #ทำการเช็คก่อนว่ามีไฟล์รูปหรือไม่ if($c_arr[9]==""){ }else{ $file_com = "$path/$c_arr[9]"; #ไฟล์รูป if (file_exists( $file_com )) { unlink("$file_com"); } else { }; #ทำการลบรูปออกไป }; } #ทำการลบข้อมูล $sql = "DELETE FROM webboard_ans WHERE QuestionNo='$No' and No_com='$comt'"; $result = mysql_db_query($dbname,$sql); #ทำการอัพเดตข้อมูล $sql1 = "UPDATE webboard_data Set Reply=Reply-1 WHERE No='$No'"; $result1 = mysql_db_query($dbname,$sql1); mysql_close(); #โชว์รายละเอียด print "<meta http-equiv=refresh content=0;URL=show.php?Category=$Category&No=$No>"; ?> </body> </html>
©
2018.