Tenho uma página Index.php, onde serão abertos outras páginas através de includes.
Quando imprimo a variável módulo, na página Index.php. percebo que ela não altera de valor conferme deveria, pois na página head, de acordo com o clique no menu mando um paramentro, mas este não está chegando na index.php...O que preciso fazer pra mandar um paramentro do head pra index....
Sei que o código está imenso. mas se alguém puder me ajudar. Ficarei muito feliz...
<?php
global $modulo;
if (!isset($modulo))
$modulo='estatisticas';
include ("head.php");
global $cadastro;
if (!isset($cadastro))
$cadastro='exames';
[b]echo $modulo;[/b]
switch($modulo){
case 'estatisticas':
include("cadastro.php");
break;
case 'solicitacao':
include("cadastroHistorico.php");
break;
}
include ("footer.php");
?>
Tenho uma página Head, onde está o menu:
Abaixo o Trecho onde envio o paramentro:
Pergunta
MalloryKnox
Tenho uma página Index.php, onde serão abertos outras páginas através de includes.
Quando imprimo a variável módulo, na página Index.php. percebo que ela não altera de valor conferme deveria, pois na página head, de acordo com o clique no menu mando um paramentro, mas este não está chegando na index.php...O que preciso fazer pra mandar um paramentro do head pra index....
Sei que o código está imenso. mas se alguém puder me ajudar. Ficarei muito feliz...
<?php global $modulo; if (!isset($modulo)) $modulo='estatisticas'; include ("head.php"); global $cadastro; if (!isset($cadastro)) $cadastro='exames'; [b]echo $modulo;[/b] switch($modulo){ case 'estatisticas': include("cadastro.php"); break; case 'solicitacao': include("cadastroHistorico.php"); break; } include ("footer.php"); ?>Tenho uma página Head, onde está o menu: Abaixo o Trecho onde envio o paramentro: Código completo da página head.php<html> <head> <script language=JavaScript type="text/javascript"> function MenuMouseover(left,middle,right) { document.getElementById(left).className = "HMenuLeftOver"; document.getElementById(middle).className = "HMenuMiddleOver"; document.getElementById(right).className = "HMenuRightOver"; } function MenuMouseOut(left,middle,right) { document.getElementById(left).className = "HMenuLeftNormal"; document.getElementById(middle).className = "HMenuMiddleNormal"; document.getElementById(right).className = "HMenuRightNormal"; } function MenuCurrent(left,middle,right) { document.getElementById(left).className = "HMenuLeftActive"; document.getElementById(middle).className = "HMenuMiddleActive"; document.getElementById(right).className = "HMenuRightActive"; } function showMenuAsDialog(holder, source) { var reqX = findPosX(document.getElementById(holder)); var reqY = findPosY(document.getElementById(holder)); var offsetWidth = document.getElementById(holder).offsetHeight showDialog(document.getElementById(source).innerHTML,'position=absolute,closeButton=no,closeOnBodyClick=yes,srcElement=CreateNew_PH,left=' + (reqX-document.body.scrollLeft) + ',top=' + (reqY+ offsetWidth-document.body.scrollTop)); } function showLayer(layerName) { if (document.getElementById) // Netscape 6 and IE 5+ { var targetElement = document.getElementById(layerName); targetElement.style.visibility = 'visible'; } } function hideLayer(layerName) { if (document.getElementById) { var targetElement = document.getElementById(layerName); targetElement.style.visibility = 'hidden'; } } </script> <script language="JavaScript1.2" src="js/common.js"></script> <script language="JavaScript1.2" src="js/jquery-1.3.2.min.js"></script> <script language="JavaScript1.2" src="js/SCPJquery.js"></script> <link rel="stylesheet" href="css/menu.css" type="text/css"> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/custom_style.css" type="text/css"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="loadme();"> <input type="hidden" value="Carregando aguarde..." id="loadingMsg" name="loadingMsg"> <div align="center" style='width: 100%; vertical-align: top; position: relative;'> <!--Começo do Header--> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td valign="top" height="80" id="MainHeader"> <table cellpadding="0" cellspacing="0" border="0" width="100%" height="80"> <tr> <td valign="top"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td nowrap="nowrap" width="170" valign="middle" height="50"> <img src="images/scp-header-logo.png" border="0" > </td> <td valign="middle" nowrap="nowrap" > <table cellpadding="0" cellspacing="0" border="0"> <tr> </tr> </table> </td> <td align="right" valign="middle" nowrap="nowrap" > <table border="0" cellspacing="0" cellpadding="0" class="topHeaderLinks"> <tr> <td align="center" nowrap="nowrap" id="ProductHelpTD"><a href="java script:void(0)" onClick="" >Ajuda <img src="images/scp-HTR-Darrow.gif" width="6" height="3" align="absmiddle" border="0" ></a></td> <td width="16" align="center" nowrap="nowrap" class="fontgray">|</td> <td align="center" nowrap><a href="" class="FontBlack">Alterar senha</a></td> <td width="16" align="center" nowrap="nowrap" class="fontgray">|</td> <td width="16"></td> <td nowrap="nowrap" ><span class="logTxt"><a href="" class="FontBlack"><?php ?></a></span> (<a href="">Logout</a>)</td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td valign="bottom"> <!-- Começo Menu Superior --> <table cellpadding="0" cellspacing="0" border="0" id="TabMenu"> <tr> <td class="MenuTabSec" nowrap="nowrap" valign="top"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="HTRMenuDiv" <?php if($modulo=='estatisticas') echo ''; else echo " onMouseOver=\"java script:MenuMouseover('Início_Left','Início_Middle','Início_Right');\" onMouseOut=\"java script:MenuMouseOut('Início_Left','Início_Middle','Início_Right');\"";?>> <table cellpadding="0" cellspacing="0" height="24" border="0" > <tr > <td id="Início_Left" class="HMenuLeft<?php if($modulo=='estatisticas') echo 'Active'; else echo 'Normal';?>"> </td> <td id="Início_Middle" class="HMenuMiddle<?php if($modulo=='estatisticas') echo 'Active'; else echo 'Normal';?>" nowrap="nowrap"> <a href="index.php?modulo=estatisticas">Início</a> </td> <td id="Início_Right" class="HMenuRight<?php if($modulo=='estatisticas') echo 'Active'; else echo 'Normal';?>"> </td> </tr> </table> </td> <!-- menu lista --> <td class="HTRMenuDiv" <?php if($modulo=='list_atendimento') echo ''; else echo " onMouseOver=\"java script:MenuMouseover('Solicitações_Left','Solicitações_Middle','Solicitações_Right');\" onMouseOut=\"java script:MenuMouseOut('Solicitações_Left','Solicitações_Middle','Solicitações_Right');\"";?>> <table cellpadding="0" cellspacing="0" height="24" border="0" > <tr > <td id="Solicitacoes_Left" class="HMenuLeft<?php if($modulo=='list_atendimento') echo 'Active'; else echo 'Normal';?>"> </td> <td id="Solicitacoes_Middle" class="HMenuMiddle<?php if($modulo=='list_atendimento') echo 'Active'; else echo 'Normal';?>" nowrap="nowrap"> <a href="index.php?modulo=solicitacao">Solicitacoes</a> </td> <td id="Solicitações_Right" class="HMenuRight<?php if($modulo=='list_atendimento') echo 'Active'; else echo 'Normal';?>"> </td> </tr> </table> </td> <td class="HTRMenuDiv" <?php if($modulo=='reports') echo ''; else echo " onMouseOver=\"java script:MenuMouseover('Relatórios_Left','Relatórios_Middle','Relatórios_Right');\" onMouseOut=\"java script:MenuMouseOut('Relatórios_Left','Relatórios_Middle','Relatórios_Right');\"";?>> <table cellpadding="0" cellspacing="0" height="24" border="0" > <tr > <td id="Relatórios_Left" class="HMenuLeft<?php if($modulo=='reports') echo 'Active'; else echo 'Normal';?>"> </td> <td id="Relatórios_Middle" class="HMenuMiddle<?php if($modulo=='reports') echo 'Active'; else echo 'Normal';?>" nowrap="nowrap"> <a href="admin.php?modulo=reports">Relatórios</a> </td> <td id="Relatórios_Right" class="HMenuRight<?php if($modulo=='reports') echo 'Active'; else echo 'Normal';?>"> </td> </tr> </table> </td> </tr> </table> </td> <td width="20"><img src="images/spacer.gif" width="20" height="1" border="0"></td> </td> </tr> </table> <!-- Fim do Menu Superior --> <!--FIM do Header--> </tr> </table> </td> </tr> </table> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr class=fontBlack> <td align=left valign=top> <table width=100% border=0 cellpadding=0 cellspacing=0> <tr class=fontBlack> <td width=100% align=left valign=top class=padding4><!--Start Contents--> <div id =homePageContent style=display:block;> <div id=sdp.inventory.wsRtPanel.userDetails class=hide>User Details</div> <table width=100% cellpadding=0 cellspacing=0 border=0> <tr> <td valign=top class=DBStartTD> <!-- Começa o Conteúdo-->Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.