-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete_ad_admin.php
More file actions
37 lines (34 loc) · 798 Bytes
/
Copy pathdelete_ad_admin.php
File metadata and controls
37 lines (34 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
function redirect($url)
{
if (!headers_sent())
{
header('Location: '.$url);
exit;
}
else
{
echo '<script type="text/javascript">';
echo 'window.location.href="'.$url.'";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>'; exit;
}
}
?>
<?php
include("config.php");
include("session.php");
// get all the ad data
if($_SERVER["REQUEST_METHOD"] == "POST" && isset ($_POST['Delete'])){
$adID = $_POST["Delete"];
//modify in database
$sql = "UPDATE ads
SET deleted='deleted'
WHERE AdID = $adID ";
if($result = $conn->query($sql)){
redirect("manage_users_ads.php");
}
}
?>