Your IP : 10.1.73.149


Current Path : /home/bolconlineco/public_html/admin/
Upload File :
Current File : //home/bolconlineco/public_html/admin/delete_videos.php

<?php
ob_start();
include('../includes/connection/func.inc.php');  
	
	  
	   
	   $id=sql_strip($_GET['id']);
	
	  
	  
	   $sql = "select videopath from coursevideo where  id='$id'";
	   
	   $result = mysql_query($sql) or die(mysql_error());
	   
	    if(mysql_num_rows($result) > 0)
		 {
			 
			$resultSet=mysql_fetch_array($result);
			if(file_exists('../combine/coursevideos/'.$resultSet['videopath']))
			 {
				if(unlink('../combine/coursevideos/'.$resultSet['videopath']))
				 {
						$sq="delete from coursevideo where id='$id'";
						 $result=mysql_query($sq) or die(mysql_error());
						 mysql_query("delete from tbl_coursevideos where videoId='$id'") or die(mysql_error());
						 $msg="Deleted Successfully";
						 header("location:videos.php?msg=$msg");
						 exit();
				 }
			 }
			 else
			 {
						 $sq="delete from coursevideo where  id='$id'";
						 $result=mysql_query($sq) or die(mysql_error());
						// mysql_query("delete from tbl_coursevideos where videoId='$id'") or die(mysql_error());
						 $msg="Deleted Successfully";
						 header("location:videos.php?msg=$msg");
						 exit();
			 }
		
	  
    	  
	  
	 	
	}

?>