# insert-html-snippet/1.0/admin/snippet-status.php

Insert Html Snippet, version 1.0. 29 lines.

- Page: https://pluginprobe.com/plugins/insert-html-snippet/1.0/code/admin/snippet-status.php
- Raw: https://pluginprobe.com/plugins/insert-html-snippet/1.0/raw/admin/snippet-status.php
- Modified: 2012-08-16T05:32:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/insert-html-snippet/1.0/code/admin/snippet-status.php#L10-L20`.

```php
<?php

global $wpdb;

$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);

$xyz_ihs_snippetId = intval($_GET['snippetId']);
$xyz_ihs_snippetStatus = intval($_GET['status']);
$xyz_ihs_pageno = intval($_GET['pageno']);
if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
	header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
	exit();

}

$snippetCount = $wpdb->query( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id="'.$xyz_ihs_snippetId.'" LIMIT 0,1' ) ;

if($snippetCount==0){
	header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
	exit();
}else{
	
	$wpdb->update($wpdb->prefix.'xyz_ihs_short_code', array('status'=>$xyz_ihs_snippetStatus), array('id'=>$xyz_ihs_snippetId));
	header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=4&pagenum='.$xyz_ihs_pageno));
	exit();
	
}
?>
```
