Having some trouble, and not sure where my prob is. This function SHOULD read the contents of a file (five sections named $cipher) include them one at a time, decrypt them, then echo them out in a div (class+1). If the file does not exist, it should die quietly. This was just a quick type-out so I’m not sure what errors are in it.
[code=php]
<?php
function tpout() {
GLOBAL $noko, $sct, $path;
$spec = array (
0 => ‘Specifications’, 1 => ‘Information’,
2 => ‘Maintenance’, 3 => ‘Safety’,
4 => ‘Troubleshooting’, ); # Declare TAPS
# Javascript to Run Show/Hide DIV’s
echo ‘<script type=”text/javascript”>’
echo ‘function tapper() {
el=document.getElementsByTagName(“div”)
for(var i=0;i<el.length;i++){
if(el[i].className==”tap”) {
if(el[i].style.display==”none”||el[i].style.display==””) {
el[i].style.display=”block”
} else {
el[i].style.display=”none”
} }
}
}’;
echo ‘</script>’;
# Style Configurator
echo ‘<style> .tap{ display:none; } </style>’;
echo ‘<div id=”tb”>’;
$i = 0; $name = $noko[1]; # Zeroing Out Increments
# Check if we really have a file to work with
$filename = $_SERVER[‘DOCUMENT_ROOT’] . “/$sct/$path/$name.php”;
if (file_exists($filename)) { include ($filename);
foreach ( $cipher AS $string ) {
# Name out Array Contents
echo “<div class=”tab”><a href=”#”>$spec[$i]</a>”;
echo “<div class=’tap$i’ style=”display:none”>”;
$hash = decrypt($s); stripslashes($hash); $i++;
echo $hash.”</div>”; # Push Decrypted Data
}
echo ‘</div>’;
$i = NULL; # Destroy Increments
} else { /* Die without Error */ }
?>