| 1 |
<?php |
| 2 |
global $wpdb; |
| 3 |
|
| 4 |
$_POST = stripslashes_deep($_POST); |
| 5 |
$_GET = stripslashes_deep($_GET); |
| 6 |
|
| 7 |
$xyz_ihs_snippetId = intval($_GET['snippetId']); |
| 8 |
$xyz_ihs_pageno = intval($_GET['pageno']); |
| 9 |
|
| 10 |
if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){ |
| 11 |
header("Location:".admin_url('admin.php?page=insert-html-snippet-manage')); |
| 12 |
exit(); |
| 13 |
|
| 14 |
} |
| 15 |
$snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1',$xyz_ihs_snippetId )) ; |
| 16 |
|
| 17 |
if($snippetCount==0){ |
| 18 |
header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2')); |
| 19 |
exit(); |
| 20 |
}else{ |
| 21 |
|
| 22 |
$wpdb->query($wpdb->prepare( 'DELETE FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d',$xyz_ihs_snippetId)) ; |
| 23 |
|
| 24 |
header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=3&pagenum='.$xyz_ihs_pageno)); |
| 25 |
exit(); |
| 26 |
|
| 27 |
} |
| 28 |
?> |