| Current Path : /home/bolconlineco/public_html/aaaaaa/admin/ |
| Current File : /home/bolconlineco/public_html/aaaaaa/admin/delete_suportmaterials.php |
<?php
ob_start();
session_start();
?>
<?php
include('../includes/connection/func.inc.php');
if(isset($_GET['id'])) // Start of if condition
{
$id = $_GET['id'];
$query = "SELECT name from sportmaterials where id='$id'";
$result = mysql_query($query) or die(mysql_error());
$fetch = mysql_fetch_array($result);
if(file_exists('../sportmaterials/'.$fetch['name']))
{
unlink('../sportmaterials/'.$fetch['name']);
}
$qq = "delete from sportmaterials where id='$id'";
$res = mysql_query($qq) or die(mysql_error());
header("location:suportmaterials.php?msg=deleted Successfully");
exit();
} // End of main if condition
?>