我手里有几个变量:$LOGIN_USER_ID 职位 ID
$LOGIN_USER_PRIV 用户ID
$LOGIN_DEPT_ID 部门ID
如果新建个页面上面链接成http://localhost/.1asp?id=<?php echo$LOGIN_DEPT_ID;?>&yh=<?php echo$LOGIN_USER_PRIV;?>&part=<?php echo $LOGIN_DEPT_ID;?>就没问题可为
什么我不能在数据库菜单里将变量输出呢?menu.php代码在这里大家帮忙给看看是不是哪里给了限制
<?
  include_once 'inc/reg_check.php';
  if (($OA_REG_ON != 2008))
  {
    exit ();
  }
  $MENU_CSS = 1;
  include_once 'inc/auth.php';
  echo '
<html>
<head>
<title>主菜单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript>
function my_on_status()
{
location="menu.php?ISPIRIT=';
  echo $ISPIRIT;
  echo '&ON_STATUS_SET="+ON_STATUS.value;
}
</script>
</head>
';
  $query = (((''.'SELECT USER_NAME,BKGROUND,ON_STATUS from USER where USER_ID=\'').$LOGIN_USER_ID).'\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $USER_NAME = $ROW['USER_NAME'];
    $BKGROUND = $ROW['BKGROUND'];
    $ON_STATUS = $ROW['ON_STATUS'];
  }
  if ((($ON_STATUS_SET != '') AND ($ON_STATUS_SET != $ON_STATUS)))
  {
    $query = (((((''.'update USER set ON_STATUS=\'').$ON_STATUS_SET).'\' where USER_ID=\'').$LOGIN_USER_ID).'\'');
    exequery ($connection, $query);
    $ON_STATUS = $ON_STATUS_SET;
  }
  echo '
<body topmargin="0" leftmargin="0" rightMargin="0" class="panel" marginwidth="0" marginheight="0">
<!-- OA树开始-->
<table class="small" border="0" width="100%" cellspacing="0" cellpadding="0" align="center"><tr><td>
';
  if ($ISPIRIT)
  {
    echo '   <table class="small" border="0" cellspacing="0" cellpadding="2" height="25" width="100%" >
    <tr class="TableHeader">
     <td class="small" nowrap><img src="/images/avatar/';
    echo $LOGIN_AVATAR;
    echo '.gif" width=15 height=15 align="absmiddle">
     <b>';
    echo $USER_NAME;
    echo '</b>
     </td>
     <td class="small">
     ';
    echo '<s';
    echo 'elect class="SmallSelect" name="ON_STATUS" onchange="my_on_status()">
     <option value="1" ';
    if (($ON_STATUS == 1))
    {
      echo 'selected';
    }
    echo '>正常</option>
     <option value="2" ';
    if (($ON_STATUS == 2))
    {
      echo 'selected';
    }
    echo '>忙碌</option>
     <option value="3" ';
    if (($ON_STATUS == 3))
    {
      echo 'selected';
    }
    echo '>离开</option>
     </select>
     </td>
     <td class="small">
       <a href="javascript:openURL(\'/general\')"><u>OA</u></a>
     </td>
    </tr>
   </table>
';
    $MENU_ID = '';
  }
  if ($OA_SUB_WINDOW)
  {
    $MENU_ID = '';
  }
  $USER_FUNC_ID_STR = $LOGIN_FUNC_STR;
  if (($LOGIN_USER_ID == 'admin'))
  {
    ($USER_FUNC_ID_STR .= '32,33,56,');
  }
  $USER_FUNC_ID_STR = substr ($USER_FUNC_ID_STR, 0, -1);
  if (($MENU_ID == ''))
  {
    $query = 'SELECT * from SYS_MENU order by MENU_ID';
  }
  else
  {
    $query = (((''.'SELECT * from SYS_MENU where MENU_ID=\'').$MENU_ID).'\'');
  }
  $cursor = exequery ($connection, $query);
  $NUM_ROWS1 = mysql_num_rows ($cursor);
  $MENU_END1 = 0;
  while ($ROW = mysql_fetch_array ($cursor))
  {
    $MENU_ID1 = $ROW['MENU_ID'];
    $MENU_NAME = $ROW['MENU_NAME'];
    $IMAGE = $ROW['IMAGE'];
    $query1 = (((((''.'SELECT * from SYS_FUNCTION where MENU_ID like \'').$MENU_ID1).'%\' and FUNC_ID in(').$USER_FUNC_ID_STR).') and length(MENU_ID)=4 order by MENU_ID');
    $cursor1 = exequery ($connection, $query1);
    $NUM_ROWS2 = mysql_num_rows ($cursor1);
    $MENU_END2 = 0;
    $SUB_MENU_COUNT = 0;
    while ($ROW = mysql_fetch_array ($cursor1))
    {
      $MENU_ID2 = $ROW['MENU_ID'];
      $FUNC_ID = $ROW['FUNC_ID'];
      $FUNC_NAME = $ROW['FUNC_NAME'];
      $FUNC_CODE = $ROW['FUNC_CODE'];
      if ((((600 <= $FUNC_ID) AND ($FUNC_ID <= 1000)) OR (strtolower (substr ($FUNC_CODE, -4)) == '.jsp')))
      {
        $BASE_PATH = 'app';
      }
      else
      {
        $BASE_PATH = 'general';
      }
      if (strstr ($FUNC_CODE, 'http://'))
      {
        $FUNC_IMAGE = 'menu_url';
      }
      else
      {
        if (strstr ($FUNC_CODE, 'file://'))
        {
          $FUNC_IMAGE = 'winexe';
        }
        else
        {
          if (strstr ($FUNC_CODE, '/'))
          {
            $FUNC_IMAGE = substr ($FUNC_CODE, 0, strpos ($FUNC_CODE, '/'));
          }
          else
          {
            $FUNC_IMAGE = $FUNC_CODE;
          }
        }
      }
      if (($FUNC_CODE == 'bbs2/admin'))
      {
        $FUNC_IMAGE = 'system';
      }
      ++$SUB_MENU_COUNT;
      if (($SUB_MENU_COUNT == 1))
      {
        ++$MENU_COUNT;
      }
      if (($MENU_COUNT == $NUM_ROWS1))
      {
        $MENU_END1 = 1;
      }
      if (($SUB_MENU_COUNT == $NUM_ROWS2))
      {
        $MENU_END2 = 1;
      }
      if (($SUB_MENU_COUNT == 1))
      {
        echo ' <table class="small" border="0" cellspacing="0" cellpadding="0">
   <tr>
    <td>
     <img src="/images/menu/';
        if (($MENU_ID != ''))
        {
          echo 'tree_minusl';
        }
        else
        {
          if (($MENU_END1 OR ($MENU_ID != '')))
          {
            echo 'tree_plusl';
          }
          else
          {
            echo 'tree_plus';
          }
        }
        echo '.gif" id="MEMU_';
        echo $MENU_ID1;
        echo '" class="outline" style="cursor:hand" onclick="myclick(this)">
    </td>
    <td><img src="/images/menu/';
        echo $IMAGE;
        echo '.gif" border="0" WIDTH="19" HEIGHT="17"></td>
    <td colspan="3"><a href="javascript:myclick(MEMU_';
        echo $MENU_ID1;
        echo ')">&nbsp;';
        echo $MENU_NAME;
        echo '</a>
';
        if (($MENU_COUNT == 1))
        {
          echo '     &nbsp;&nbsp;&nbsp;<a href="javascript:menu_expand()"><u>';
          echo '<s';
          echo 'pan id="expand_text">展开</span></u></a>
';
        }
        echo '  </td>
   </tr>
 </table>
 <table class="small" border="0" cellspacing="0" cellpadding="0" id="MEMU_';
        echo $MENU_ID1;
        echo 'd" style="display:';
        if (($MENU_ID == ''))
        {
          echo 'none';
        }
        echo '">
   <tr><td>
';
      }
      if ((substr ($FUNC_CODE, 0, 1) != '@'))
      {
        if (strstr ($FUNC_CODE, 'http://'))
        {
          $CLICK_STR = (((''.'openURL(\'').$FUNC_CODE).'\')');
        }
        else
        {
          if (strstr ($FUNC_CODE, 'file://'))
          {
            $CLICK_STR = (((((''.'winexe(\'').$FUNC_NAME).'\',\'').str_replace ('\\', '/', str_replace ('file://', '', $FUNC_CODE))).'\')');
          }
          else
          {
            $CLICK_STR = (((((''.'openURL(\'/').$BASE_PATH).'/').$FUNC_CODE).'\')');
          }
        }
        echo '      <table class="small" border="0" cellspacing="0" cellpadding="0">
        <tr>
         <td><img src="/images/menu/';
        if (($MENU_END1 OR ($MENU_ID != '')))
        {
          echo 'tree_transp';
        }
        else
        {
          echo 'tree_line';
        }
        echo '.gif" border="0"></td>
         <td><img src="/images/menu/';
        if ($MENU_END2)
        {
          echo 'tree_blankl';
        }
        else
        {
          echo 'tree_blank';
        }
        echo '.gif"></td>
         <td><img src="/images/menu/';
        echo $FUNC_IMAGE;
        echo '.gif" border="0" WIDTH="19" HEIGHT="17"></td>
         <td colspan="2"><a href="javascript:';
        echo $CLICK_STR;
        echo '">&nbsp;';
        echo $FUNC_NAME;
        echo '</a></td>
        </tr>
      </table>
';
        continue;
      }
      else
      {
        echo '      <table class="small" border="0" cellspacing="0" cellpadding="0">
        <tr>
         <td><img src="/images/menu/';
        if (($MENU_END1 OR ($MENU_ID != '')))
        {
          echo 'tree_transp';
        }
        else
        {
          echo 'tree_line';
        }
        echo '.gif" border="0"></td>
         <td><img src="/images/menu/';
        if ($MENU_END2)
        {
          echo 'tree_plusl';
        }
        else
        {
          echo 'tree_plus';
        }
        echo '.gif"   id="MEMU_';
        echo $MENU_ID2;
        echo '" class="outline" style="cursor:hand" onclick="myclick(this)"></td>
         <td><img src="/images/menu/';
        echo $FUNC_IMAGE;
        echo '.gif" border="0" WIDTH="19" HEIGHT="17"></td>
         <td colspan="2"><a href="javascript:myclick(MEMU_';
        echo $MENU_ID2;
        echo ')">&nbsp;';
        echo $FUNC_NAME;
        echo '</a></td>
        </tr>
      </table>
      <table class="small" border="0" cellspacing="0" cellpadding="0" id="MEMU_';
        echo $MENU_ID2;
        echo 'd" style="display:none;">
        <tr>
         <td>

解决方案 »

  1.   

    ';
            $query2 = (((((''.'SELECT * from SYS_FUNCTION where MENU_ID like \'').$MENU_ID2).'%\' and FUNC_ID in(').$USER_FUNC_ID_STR).') and length(MENU_ID)=6 order by MENU_ID');
            $cursor2 = exequery ($connection, $query2);
            $NUM_ROWS3 = mysql_num_rows ($cursor2);
            $MENU_END3 = 0;
            $SUB_SUB_MENU_COUNT = 0;
            while ($ROW = mysql_fetch_array ($cursor2))
            {
              $MENU_ID3 = $ROW['MENU_ID'];
              $FUNC_ID = $ROW['FUNC_ID'];
              $FUNC_NAME = $ROW['FUNC_NAME'];
              $FUNC_CODE = $ROW['FUNC_CODE'];
              if (strstr ($FUNC_CODE, 'http://'))
              {
                $FUNC_IMAGE = 'menu_url';
              }
              else
              {
                if (strstr ($FUNC_CODE, 'file://'))
                {
                  $FUNC_IMAGE = 'winexe';
                }
                else
                {
                  if (strstr ($FUNC_CODE, '/'))
                  {
                    $FUNC_IMAGE = substr ($FUNC_CODE, 0, strpos ($FUNC_CODE, '/'));
                  }
                  else
                  {
                    $FUNC_IMAGE = $FUNC_CODE;
                  }
                }
              }
              if (($FUNC_CODE == 'bbs2/admin'))
              {
                $FUNC_IMAGE = 'system';
              }
              ++$SUB_SUB_MENU_COUNT;
              if (($SUB_SUB_MENU_COUNT == $NUM_ROWS3))
              {
                $MENU_END3 = 1;
              }
              if (strstr ($FUNC_CODE, 'http://'))
              {
                $CLICK_STR = (((''.'openURL(\'').$FUNC_CODE).'\')');
              }
              else
              {
                if (strstr ($FUNC_CODE, 'file://'))
                {
                  $CLICK_STR = (((((''.'winexe(\'').$FUNC_NAME).'\',\'').str_replace ('\\', '/', str_replace ('file://', '', $FUNC_CODE))).'\')');
                }
                else
                {
                  $CLICK_STR = (((((''.'openURL(\'/').$BASE_PATH).'/').$FUNC_CODE).'\')');
                }
              }
              echo '
               <table class="small" border="0" cellspacing="0" cellpadding="0">
                 <tr>
                  <td><img src="/images/menu/';
              if (($MENU_END1 OR ($MENU_ID != '')))
              {
                echo 'tree_transp';
              }
              else
              {
                echo 'tree_line';
              }
              echo '.gif"></td>
                  <td><img src="/images/menu/';
              if ($MENU_END2)
              {
                echo 'tree_transp';
              }
              else
              {
                echo 'tree_line';
              }
              echo '.gif" border="0"></td>
                  <td><img src="/images/menu/';
              if ($MENU_END3)
              {
                echo 'tree_blankl';
              }
              else
              {
                echo 'tree_blank';
              }
              echo '.gif"></td>
                  <td><img src="/images/menu/';
              echo $FUNC_IMAGE;
              echo '.gif" border="0" WIDTH="19" HEIGHT="17"></td>
                  <td colspan="2"><a href="#A" onclick="';
              echo $CLICK_STR;
              echo '">&nbsp;';
              echo $FUNC_NAME;
              echo '</a></td>
                 </tr>
               </table>
    ';
            }
            echo '         </td>
            </tr>
           </table>
    ';
            continue;
          }
        }
        echo '      </td>
         </tr>
        </table>
    ';
      }
      
      echo '
    ';
      echo '<s';
      echo 'cript language="JavaScript">
    var openedid;
    var openedid_ft;
    var flag=0,sflag=0;
    //-------- 菜单点击事件 -------
    function myclick(srcelement)
    {
      var targetid,srcelement,targetelement;
      var strbuf;
      //-------- 如果点击了展开或收缩按钮---------
      if(srcelement.className=="outline")
      {
         targetid=srcelement.id+"d";
         targetelement=document.all(targetid);
         if (targetel';
      echo 'ement.style.display=="none")
         {
            targetelement.style.display=\'\';
            strbuf=srcelement.src;
            if(strbuf.indexOf("plus.gif")>-1)
                    srcelement.src="/images/menu/tree_minus.gif";
            else
                    srcelement.src="/images/menu/tree_minusl.gif";
         }
         else
         {
            targetelement.style.display="none";
            strbuf=srcelement.src;
     ';
      echo '       if(strbuf.indexOf("minus.gif")>-1)
                    srcelement.src="/images/menu/tree_plus.gif";
            else
                    srcelement.src="/images/menu/tree_plusl.gif";
         }
      }
    }
    //-------- 打开网址 -------
    function openURL(URL)
    {
    ';
      if (($OA_SUB_WINDOW == 1))
      {
        echo '    mytop=(screen.availHeight-500)/2-30;
        myleft=(screen.availWidth-780)/2;
        window.open(URL,"","height=500,width=780,status=0,toolbar=no,menubar=yes,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
        window.close();
    ';
      }
      else
      {
        echo '    parent.openURL(URL,0);
    ';
      }
      echo '}
    //-------- 菜单全部展开/收缩 -------
    var menu_flag=0;
    function menu_expand()
    {
      if(menu_flag==0)
         expand_text.innerHTML="收缩";
      else
         expand_text.innerHTML="展开";
      menu_flag=1-menu_flag;
      for (i=0; i<document.all.length; i++)
      {
        srcelement=document.all(i);
        if(srcelement.className=="outline")
        {
          targetid=srcelement.id+"d";
          targetelement=d';
      echo 'ocument.all(targetid);
          if(menu_flag==1)
          {
            targetelement.style.display=\'\';
            strbuf=srcelement.src;
            if(strbuf.indexOf("plus.gif")>-1)
               srcelement.src="/images/menu/tree_minus.gif";
            else
               srcelement.src="/images/menu/tree_minusl.gif";
          }
          else
          {
            targetelement.style.display="none";
            strbuf=srcele';
      echo 'ment.src;
            if(strbuf.indexOf("minus.gif")>-1)
               srcelement.src="/images/menu/tree_plus.gif";
            else
               srcelement.src="/images/menu/tree_plusl.gif";
          }
        }
      }
    }
    //-------- 收缩打开的主菜单项 -------
    function menu_shrink()
    {
      for(i=0; i<document.all.length; i++)
      {
        srcelement=document.all(i);
        if(srcelement.title!="")
        {
          strb';
      echo 'uf=srcelement.src;
          if(strbuf.indexOf("minus")>-1)
          {
             targetid=srcelement.id+"d";
             targetelement=document.all(targetid);
             targetelement.style.display=\'none\';
             if(strbuf.indexOf("minus.gif")>-1)
                srcelement.src="/images/menu/tree_plus.gif";
             else
                srcelement.src="/images/menu/tree_plusl.gif";
           }
         }
      ';
      echo '}
    }
    //-------- 打开windows程序 -------
    function winexe(NAME,PROG)
    {
       URL="/general/winexe?PROG="+PROG+"&NAME="+NAME;
       window.open(URL,"winexe","height=100,width=350,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=0,left=0,resizable=no");
    ';
      if (($OA_SUB_WINDOW == 1))
      {
        echo 'window.close();';
      }
      echo '}
    </script>
    </body>
    </html>
    ';
    ?>