javascript and php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

 

I am having difficulties working with a JavaScript menu that should load on
each page of my intranet site.

 

Here is a brief background of the problem:

1)       I am using PHP and SQL Server and it is running on Windows 2000
Server (yes I know this stinks but I have no choice in my office).

2)       My users first log in.  Login information is saved in the PHP
session array.  This information dynamically adjusts what the users will see
from that point on.  The higher the access level the more "stuff" they can
see.  This should be pretty common.

3)       All of my PHP functions display information correctly based on the
data stored in the session array.  For example, if the user has an
administrative login, SSN and rate of pay are displayed while this data is
not displayed for other employees.

4)       I am using a JavaScript application for my navigation menu.  I
chose this because I need collapsing menus.  There are lots of functions
under each category; if I were to use HTML for the menu, my users would have
to scroll way down to get to where they want to go - especially the ones
still using 800X600 monitor resolution.  A php function calls the JavaScript
menu and changes what is displayed based on the session array data.  

 

Here is the problem:

 My JavaScript menu DOES NOT always display.  It displays about 95% of the
time.  When it displays, it displays correctly (based on the session data).
When it doesn't display, I hit reload and it usually reappears.  What's
worse, it seems to happen randomly!  I could click the same link 10 times
and it will work perfectly.  The 11th time it might not show up.

 

Here is the small amount of information I know about the problem:

I have read through the list server achieves and think the problem may lie
with the fact that Javascript has to run at the Web Browser end and PHP has
to run at Server Side.  This probably explains how it is possible that the
two are not in sync but it does not explain WHY this happens about 5% of the
time.  It also does not explain why it happens only to the JavaScript while
always displaying the results of my php functions.

 

Here are my questions:

1) How can make this menu display 100% of the time?  I realize this may be
hard to answer without looking at all of my code.

2) Should I stop using JavaScript?  If so, what should I use instead that
allows collapsing menus?

 

Thank you for your time,

 

- Matthew Perry

 


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux