十大精典PHP项目开发全程案例+代码

源代码在线查看: del_audio_chk.php

软件大小: 12200 K
上传用户: 吕布LOVE阙
关键词: PHP 项目 案例 代码
下载地址: 免注册下载 普通下载 VIP

相关代码

									session_start();
					include "conn/conn.php";
					include "inc/chec.php";
					$file_path = "../upfiles/audio/";
					$s_sqlstr = "select * from tb_audio where id = ".$_GET[id];
					$s_rst = $conn->execute($s_sqlstr);
					if(!($s_rst == false)){	
						if(file_exists($file_path.$s_rst->fields[16])){
							if(unlink($file_path.$s_rst->fields[16]) and unlink($file_path.$s_rst->fields[2])){
								$d_sqlstr = "delete from tb_audio where id = ".$_GET[id];
								$d_rst = $conn->execute($d_sqlstr);
								if(!($d_rst == false)){
									echo "alert('删除成功');location='main.php?action=audio';";
									exit();
								}else{
									echo "alert('删除失败');history.go(-1);";
									exit();
								}
							}
						}else{
							$d_sqlstr = "delete from tb_audio where id = ".$_GET[id];
							$d_rst = $conn->execute($d_sqlstr);
							if(!($d_rst == false)){
								echo "alert('此文件已删除~');location='main.php?action=audio';";
								exit();
							}else{
								echo "alert('删除失败');history.go(-1);";
								exit();
							}
						}
					}
					else
						echo "alert('删除失败');history.go(-1);";
				?>			

相关资源