HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/httpd/html/baretube.com.new/admin/ajax/ajax.load_categories_list.php
<?
include('../db.php');
if (!$_SESSION['isAdmin']) {
    die('Error !');
}

$id = (int) $_GET['id'];
$thisniche = array();
$sresult = dbQuery("SELECT * FROM content_niches WHERE content = '$id'",false);
foreach($sresult as $srow) { 
    $thisniche[] = $srow['niche'];
}
?>

<select name="niche[]" multiple="multiple" class="full-width">
    <? $presult = dbQuery("SELECT * FROM niches ORDER BY name ASC",false); ?>
    <? foreach($presult as $srow) { ?>
        <option<? echo in_array($srow['record_num'], $thisniche) ? ' selected' : ''; ?> value="<? echo $srow['record_num']; ?>"><? echo $srow['name']; ?></option>
    <? } ?>
</select>