moos3
10-09-2007, 02:02 AM
How can I check for a simple xml object is loaded? heres what I have so far?
if(empty($_GET['t'])){
$tab = 'overview';
}
elseif(empty($_GET['t']) && !empty($_GET['p'])){
echo "You Can't have a Panel with out a Tab!";
$run = false;
}
else{
$h = $_GET['t'];
$tab = base64_decode($_GET['t']);
if(empty($_GET['p'])){
$cPanel = 1;
$nCnext = $cPanel+1;
$nCprev = (int)$cPanel-1;
}
else{
$cPanel = (int)$_GET['p'];
$nCnext = (int)$cPanel+1;
$nCprev = (int)$cPanel-1;
}
//Load XML for panels based of url
$xml = @simplexml_load_file('panels/'.$tab.'.xml');
if(empty($xml)){
$run = false;
$set = true;
}
else{
$totPanel = 0;
foreach($xml->pane as $panel){
$totPanel++;
}
$predicate = "//num[.='{$cPanel}']/ancestor::pane";
$pane1 = current($xml->xpath($predicate));
}
}
if(empty($_GET['t'])){
$tab = 'overview';
}
elseif(empty($_GET['t']) && !empty($_GET['p'])){
echo "You Can't have a Panel with out a Tab!";
$run = false;
}
else{
$h = $_GET['t'];
$tab = base64_decode($_GET['t']);
if(empty($_GET['p'])){
$cPanel = 1;
$nCnext = $cPanel+1;
$nCprev = (int)$cPanel-1;
}
else{
$cPanel = (int)$_GET['p'];
$nCnext = (int)$cPanel+1;
$nCprev = (int)$cPanel-1;
}
//Load XML for panels based of url
$xml = @simplexml_load_file('panels/'.$tab.'.xml');
if(empty($xml)){
$run = false;
$set = true;
}
else{
$totPanel = 0;
foreach($xml->pane as $panel){
$totPanel++;
}
$predicate = "//num[.='{$cPanel}']/ancestor::pane";
$pane1 = current($xml->xpath($predicate));
}
}