GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Sep-2003, 06:47
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

folder problem in trees


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
  #2  
Old 25-Sep-2003, 09:41
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
Please post your code.

We can't help you without that code
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #3  
Old 26-Sep-2003, 01:35
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
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 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
Attached Files
File Type: txt index2.txt (4.1 KB, 15 views)
  #4  
Old 26-Sep-2003, 02:20
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
I suggest you to change this code:
PHP Code:

<!--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  }?> 


to:
PHP Code:

<!--checking internal and external users---><?$sql = "SELECT user FROM t_user WHERE user = '".$HTTP_POST_VARS['account']."' intern='t'";$res = mysql_query($sql);$user_c = mysql_num_rows($res);  if ($user_c == 1) {     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  }?> 


It just checks the user in the database, if it's there mysql_num_rows will return 1 and send the user to the 3 frame page.

I haven't checked if it works. but it should be
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #5  
Old 26-Sep-2003, 02:30
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
sorry its not working unfortunately

thanks
  #6  
Old 26-Sep-2003, 02:55
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
Oops...

this sql should work...

PHP Code:

$sql = "SELECT user FROM t_user WHERE account = '".$HTTP_POST_VARS['account']."' AND intern = 't'"; 



note the AND
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #7  
Old 26-Sep-2003, 03:08
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
sorry still it not works

in login.php

<?
$sql = "SELECT user FROM t_user WHERE account = '".$HTTP_POST_VARS['account']."' AND intern = 't'";
$res = mysql_query($sql);
$user_c = mysql_num_rows($res);
if ($user_c == 1) {
header("Location: index.phtml?mode=intern;");//having 3 frames for internal users
}
else {
header("Location: index.phtml?mode=extern;");//having 2 frames for external users
}
?>

and in index.php

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']=='intern' && $user) ){
$loc = "log.phtml";
<html>
------
.......

}

else
{}

its goign to else block

thanks
  #8  
Old 26-Sep-2003, 03:11
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
Damn...

In the sql "WHERE account = " should be "WHERE user ="

I always get messedup when using another name for the posted value then for the colum name
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #9  
Old 26-Sep-2003, 03:15
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
still wont works
  #10  
Old 26-Sep-2003, 03:27
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
Here goes the debugging...

from this line
if (($HTTP_GET_VARS['mode']=='intern' && $user) ){

can you remove the " && $user" and see what happens.

could be a problem there.
also try
echo $HTTP_GET_VARS['mode'];
and
var_dump($user);
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
 
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
problem to access htdocs folders fraggle two Apache Web Server Forum 5 12-Nov-2003 00:40
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
PHP/CSS/Netscape/IE problem... :-D mateo1221 Web Design Forum 1 24-Sep-2003 16:55
client side problem zuzupus MySQL / PHP Forum 2 22-Jul-2003 06:47

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:34.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.