hi,
anybody there who can help me out from some strange situation actually im newbie in php and i got somebody s spaghettis code and i changed it entirely as in older code there r lot of arrays used and i tried to make it simpler
now problem is when i try to click on trees whether its parent or child im not able to get relevent pages on right frame but if i use older one then it shows all folders for all users and i cant set any rights for that
if anybody is really interested then i cna post my code
thanks and regards
folders problem
Moderator: General Moderators
- Leviathan
- Forum Commoner
- Posts: 36
- Joined: Tue Sep 23, 2003 7:00 pm
- Location: Waterloo, ON (Currently in Vancouver, BC)
You really need to explain yourself more. Your first post here is asking us to solve your problem for you without you even telling us what your script is trying to accomplish. I'm guessing you're doing something where you have a treeview in the left frame, and want to hook up a menu entry to a specific page, making the page display in the right frame?
thanks alor for ur feedback well im struggling to get 3rd frame for internal users and 2 frames for external users dont no what went wrong and im using version php 4.0.6
when internal user logins its showing 2 frames and ugliest part in left frame it shows scroll down bottom
plz have a look at http://server2.vitodesign.com with user err and pwd as err
it must show 3 frames as this suer is internal but it shows only 2 frames
plz have alook at attched file if not clear plz let me no as its not going to if block in attached code
thansk alot
when internal user logins its showing 2 frames and ugliest part in left frame it shows scroll down bottom
plz have a look at http://server2.vitodesign.com with user err and pwd as err
it must show 3 frames as this suer is internal but it shows only 2 frames
plz have alook at attched file if not clear plz let me no as its not going to if block in attached code
thansk alot
Code: Select all
// so when user logins it redirects to login.php and at bottom it mention that
it checks for internal users as well as external users
<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<?
expire_header();
$session->login = false;
list($sys_pk, $user, $admin, $radmin) = once_query_array("SELECT sys_pk, user, admin, radmin FROM t_user WHERE user = '".addslashes($account)."' AND password = '".addslashes($password)."'");
if (!$user) send_location_die('login.phtml?error=true');
$session->login = true;
$session->admin = is_true($admin);
$session->radmin = is_true($radmin);
$session->account = $user;
$session->sys_pk = $sys_pk;
$HTTP_SESSION_VARS["account"]=$sys_pk;
query_db("SELECT d.sys_pk, d.fk_t_directories_parent AS parent FROM t_directories d INNER JOIN tr_directories_user du ON du.fk_t_directories = d.sys_pk AND du.fk_t_user = {$sys_pk} WHERE du.has_news = 't' GROUP BY d.sys_pk");
$todo = array();
$session->open = array();
while($r = foreach_db())
$todo[] = ($r->parent > 0) ? $r->parent : -1;
while(count($todo)) {
query_db("SELECT sys_pk, fk_t_directories_parent AS parent FROM t_directories WHERE sys_pk IN (".implode(', ', $todo).")");
$todo = array();
while($r = foreach_db()) {
$todo[] = ($r->parent > 0) ? $r->parent : -1;
$session->open[$r->sys_pk] = ($r->parent > 0) ? $r->parent : -1;
}
}
$f = fopen("/home/www/www/logs/download_log", "a");
flock($f, LOCK_EX);
fwrite($f, '"L";'.
'"'.str_replace('"', '""', $session->account).'";'.
'"";'.
'"";'.
'0;'.
'"'.date('d.m.Y H:i:s').'";'.
'"'.str_replace('"', '""', $HTTP_SERVER_VARS['REMOTE_ADDR']).'"'.
"\n");
flock($f, LOCK_UN);
fclose($f);
send_location('./');
?>
<!--checking internal and external users--->
<?
$sql = "SELECT user FROM t_user WHERE intern='t' ";
$res = mysql_query($sql);
while ($row = mysql_fetch_row($res)) {
$accounts[] = $row[0];
}
if (in_array($HTTP_POST_VARS['account'],$accounts)) {
header("Location:index.phtml?mode=internal");//having 3 frames for internal users
}
else {
header("Location:index.phtml?mode=external;");//having 2 frames for external users
}
?>
-------------------------------------------------------------------
// index.phtml//
<? $dir = './'; require($dir.'lib.php'); get_session();
if (!$session->login) send_location_die('login.phtml?error=true');
list($user) = once_query_array("SELECT user FROM t_user WHERE intern='t'");
$urlleft = "browsing.phtml?diradr=" . $HTTP_GET_VARS['diradr'] . "&dirname=". $HTTP_GET_VARS['dirname'] ;
if (isset($HTTP_GET_VARS['syspk'])) {
$urlrigth = "filelist.phtml?tree=" . $HTTP_GET_VARS['syspk'] ;
} else {
$urlrigth = "blank.phtml";
}
if ($HTTP_GET_VARS['mode'] == 'internal' && $user){
$loc = "log.phtml";
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>vito design - service page</title>
</head>
<frameset framespacing="0" frameborder="0" border="0" rows="85%,15%">
<FRAMESET cols="20%,80%*">
<frame src="<?php echo $urlleft ; ?>" name="pane" scrolling="auto" />
<frame src="<?php echo $urlrigth ; ?>" name="content" scrolling="auto" />
</FRAMESET>
<frame src="<?PHP echo $loc; ?>" name="log" scrolling="auto" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
<?
}
else {
?>
<frameset framespacing="0" frameborder="0" border="0" cols="220,*">
<frame src="<?php echo $urlleft ; ?>" name="pane" scrolling="auto" />
<frame src="<?php echo $urlrigth ; ?>" name="content" />
</frameset>
<noframes>
<body>
</body>
</noframes>
<?
}
?>