object required
Posted: Wed Aug 13, 2003 3:26 am
hi,
i got problem while running this file as javascript error as object required dont no why hopefull help me out
http://172.16.0.100/scripts/test.phtml
my code is mix of PHP and javascript
thanks in advance
i got problem while running this file as javascript error as object required dont no why hopefull help me out
http://172.16.0.100/scripts/test.phtml
my code is mix of PHP and javascript
Code: Select all
<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<html>
<head>
<title>Upload</title>
<link rel="stylesheet" type="text/css" href="../styles/styles.css" />
<? if ($session->active != $active || $active) { ?>
<script language="JavaScript" type="text/javascript">
<!--
<?
if ($active && $mayRead) {
list($info, $html_file) = once_query_array("SELECT info, html_file FROM t_directories WHERE sys_pk = $active");
if (is_true($info)) {
?>
parent.framesї'content'].location.replace('../htm/<?=addslashes($html_file ? "infos/$html_file" : "empty.htm") ?>');
<? } else { ?>
parent.framesї'content'].location.replace('filelist.phtml?type=<?=(($rights == 2) ? 1 : 0) ?>&tree=<?=$active ?>');
<? } } else { ?>
parent.framesї'content'].location.replace('blank.phtml');
<? } ?>
function saveScrollPosition() {
var scrollY;
if (window.innerHeight)
{
scrollY = window.pageYOffset
}
if (document.all)
if (document.documentElement && document.documentElement.scrollTop)
{
scrollY = document.documentElement.scrollTop;
}
else if (document.body)
{
scrollY = document.body.scrollTop;
}
else
scrollY = window.pageYOffset;
parent.scrollY = scrollY;
}
function scrollWindow() {
window.scrollTo(0, parent.scrollY);
}
// -->
</script>
<? } ?>
<?
$session->active = $active;
?>
</head>
<body class="gray">
<table border="0" cellpadding="0" cellspacing="0" height="95%" width="100%">
<tr>
<td valign="top" align="left">
<?
function showTree($id, $level) {
global $tree, $session, $active;
$var = is_array($treeї$id]) ? $treeї$id] : array();
foreach($var as $pk => $name) {
if ($nameї0] == chr(1)) { $new = true; $name = substr($name, 1); } else $new = false;
if ($nameї0] == '+' || $nameї0] == '-')
$link = 'href="'.htmlentities("test.phtml?flip=$pk&close=".($session->openї$pk] ? 1 : 0)).'"';
else
$link = 'href="'.htmlentities("test.phtml?active=$pk").'"';
?>
<p class="h<?=(($level > 4) ? 7 : ($level+3)) ?>"><?=str_repeat(' ', $level*3) ?><a onclick="saveScrollPosition();" class="h<?=(($level > 4) ? 7 : ($level+3)) ?>" <?=$link ?>><?=(($active == $pk || $new) ? '<span class="'.($active == $pk ? 'white' : 'newfiles').'">' : '') ?><?=htmlentities($name) ?><?=(($active == $pk || $new) ? '</span>' : '') ?></a></p>
<?
if ($session->openї$pk])
showTree($pk, $level+1);
}
}
showTree(0, 0);
?>
</td>
</tr>
</table>
<script language="JavaScript" type="text/javascript">
<!--
setTimeout("scrollWindow();", 20);
// -->
</script>
</body>
</html>thanks in advance