Re: [drewh01] Creating a dynamic dropdown menu
Here is my header code if it helps at all:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/hummingb/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load records
list($main_pagesRecords, $main_pagesMetaData) = getRecords(array(
'tableName' => 'main_pages',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$main_pagesRecord = @$main_pagesRecords[0]; // get first record
// show error message if no matching record is found
if (!$main_pagesRecord) { dieWith404("Record not found!"); }
?>