Questo è il codice del login.php:
Codice PHP:
<?     error_reporting(E_ALL);     session_start();     $phpsession session_id();         include_once ('../includephp/include_session.php');      include_once ('../includephp/errormessage_repository.php');      #include_once ('../includephp/mysql_repository.php');     #include_once ('connect_db.php');     include_once ('../conf/config_inc.php');     include_once ('../script_php/common_script.php');          #Connessione al db     $connect_db = @mysql_connect($connection,$db_username,$db_password)          or die ($error_connectToHost."[i]".mysql_error()."[/i]"."</font></SPAN>");      @mysql_select_db($db_name, $connect_db)        or die ($error_selectDb."[i]".mysql_error()."[/i]"."</font></SPAN>");          #Prendo i dati dalla Form di Login     $Username = $_POST['login_accesso'];     $Password = $_POST['password_accesso'];        #Esegue il Logon e Assegna le autirizzazioni       $querylogon_exe = " SELECT egaweb_operatorinterni.operatorinterni_matricola, egaweb_operatorinterni.operatorinterni_cdc, egaweb_operatorinterni.operatorinterni_lingua,   egaweb_operatorinterni.operatorinterni_profilo, egaweb_operatorinterni.operatorinterni_egasett, egaweb_operatorinterni.operatorinterni_nome,    egaweb_operatorinterni.operatorinterni_cognome, egaweb_settoreaziendale.settoreaziendale_cdcsett,   egaweb_settoreaziendale.settoreaziendale_descrizionesettore, egaweb_egasettore.egasettore_descrizionega, egaweb_egasettore.egasettore_egasett,   egaweb_operatorinterni.operatorinterni_username FROM egaweb_operatorinterni   JOIN egaweb_settoreaziendale ON egaweb_operatorinterni.operatorinterni_cdc = egaweb_settoreaziendale.settoreaziendale_cdcsett      JOIN egaweb_egasettore ON egaweb_operatorinterni.operatorinterni_egasett = egaweb_egasettore.egasettore_egasett   JOIN egaweb_classprofilo ON egaweb_operatorinterni.operatorinterni_profilo = egaweb_classprofilo.classprofilo_profilo   WHERE egaweb_operatorinterni.operatorinterni_username = '$Username' AND egaweb_operatorinterni.operatorinterni_password = MD5('$Password') ";            # Eseguo la query e mi tiro fuori i dati di menu, settore aziendale e operatori interni   $query_logon = mysql_query($querylogon_exe,$connect_db)              or die ($error_logon_auth."[i]".mysql_error()."[/i]"."</SPAN>");        $rowlogon = mysql_fetch_array($query_logon);     # Salvo i valori in variabili temporanee    $matricola = $rowlogon["operatorinterni_matricola"];    $lingua = $rowlogon["operatorinterni_lingua"];    $egasett = $rowlogon["operatorinterni_egasett"];        $profilo = $rowlogon["operatorinterni_profilo"];    $cdc = $rowlogon["operatorinterni_cdc"];    $nome = $rowlogon["operatorinterni_nome"];    $cognome = $rowlogon["operatorinterni_cognome"];    $descregasett = $rowlogon["egasettore_descrizionega"];         $descrsett = $rowlogon["settoreaziendale_descrizionesettore"];     $username = $rowlogon["operatorinterni_username"];    #Carico i dati in sessione - > Anagrafica Utente    $_SESSION['Anagrafica'] = $nome." - ".$cognome;    $_SESSION['DescrEgaSett'] = $descregasett;    $_SESSION['DescrSett'] = $descrsett;    $_SESSION['Username'] = $username;       if (($matricola == '') && ($egasett == '')){     mysql_close($connect_db);     $msg = "USER-ID O PASSWORD ERRATA";     $msg = urlencode($msg); // non ci possono essere spazi nell'URL     refresh("ega.php?phpsessid=$phpsession&pagina=logon&message=$msg",10);     exit; }else{    #Carico i dati in Sessione per la query di menu     $_SESSION['Matricola'] = $matricola;    $_SESSION['Profilo'] = $profilo;    $_SESSION['CDC'] = $cdc;    $_SESSION['EgaSett'] = $egasett;      $_SESSION['Lingua'] = $lingua;    include_once ('../includephp/sidemenu_string.php');        refresh("ega.php?phpsessid=$phpsession&pagina=welcome",10); } mysql_close($connect_db); ?>
e poi ega.php :
Codice PHP:
<? include_once ('../script_php/common_script.php'); include_once ('sidemenu.php'); include_once ('statusbar.php');  $campi_generici "<input type=\"hidden\"  value=".$UTECREAZ." name=\"UTECREAZ\" maxlenght=\"12\" size=\"12\"> 
"
$campi_generici .= "<input type=\"hidden\" value=".$UTEUPDATE." name=\"UTEUPDATE\" maxlenght=\"12\" size=\"12\"> 
"
$campi_generici .= "<input type=\"hidden\" value=".$TIMESTAMPCREAZ." name=\"TIMESTAMPCREAZ\" maxlenght=\"20\" size=\"20\"> 
"
$campi_generici .= "<input type=\"hidden\" value=".$TIMESTAMPUPDATE." name=\"TIMESTAMPUPDATE\" maxlenght=\"20\" size=\"20\"> 
"
$campi_generici .= "<input type=\"hidden\" value=".$NUMEROPAGINAVANTI ." name=\"NUMEROPAGINAVANTI\" maxlenght=\"4\" size=\"4\"> 
"
$campi_generici .= "<input type=\"hidden\" value=".$NUMEROPAGINAINDIETRO." name=\"NUMEROPAGINAINDIETRO\" maxlenght=\"4\" size=\"4\"> 
"
?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="it">     <head>         <title>.:: E.G.A. 2008 Web Application - Elenco.Generale.Attivita' Web ::.</title>         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">         <link href="../css/egawebstyles.css" rel="stylesheet" media="screen" type="text/css"/>         <script type="text/javascript" src="../script_js/common_script.js"></script>     </head>     <body leftmargin="0" topmargin="0" bgcolor="#ffffff" marginheight="0" marginwidth="0"><center/>         <table class="frame" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="580" width="100%">         <tbody>             <?              callSezione('../includephp/banner.php');             ?>             <tr valign="top">                 <td>                     <table border="0" cellpadding="0" cellspacing="0" height="400" width="100%">                         <tbody>                             <tr>                                 <td class="bordo_menu" valign="top" width="21%">                                     <table align="center" width="95%">                                         <tbody>                                             <tr>                                                  <td valign="top" align="center">                                                       [img]../images/home_logo.png[/img]                                                 </td>                                             </tr>                                             <tr>                                                 <td></td>                                             </tr>                                                                                          <? if (isset($_GET['pagina']) && ($_GET['pagina'] == "logon" || $_GET['pagina'] == "changepassword")) { ?>                                              <tr>                                                 <td class="text_menu_left" height="30">                                                      [b]Utility[/b]                                                 </td>                                             </tr>                                             <tr>                                                 <td class="menu-opz" onmouseover="this.className='menu-opz-over'" onmouseout="this.className='menu-opz'" class="bordo_menu">                                                     [url="ega.php?pagina=logon"]Home[/url]                                                 </td>                                             </tr>                                             <tr>                                                 <td class="menu-opz" onmouseover="this.className='menu-opz-over'" onmouseout="this.className='menu-opz'" class="bordo_menu">                                                     [url="ega.php?pagina=changepassword"]Change Password[/url]                                                 </td>                                             </tr>                                             <?                                             }else{                                                 #Stampa SideMenu                                                 callTemplate($sidemenu);                                             }                                             ?>                                         </tbody>                                     </table>                                 </td>                                 <td class="bordo_menu" valign="top" width="79%">                                     <table align="center" border="0" width="100%">                                         <tbody>                                             <? if (isset($_GET['pagina']) && ($_GET['pagina'] == "logon" || $_GET['pagina'] == "changepassword")) { ?>                                              <tr valign="top">                                                 <td class="bordo_menu" bgcolor="lightyellow" align="center">                                                    <font color="Navy">[b][i]E.G.A. WEB APPLICATION[b][/i]</font>                                                 </td>                                            </tr>                                             <? } else {                                              #Stampa StatusBar                                             callTemplate($statusbar);                                             }                                                 ?>                                                                                         <tr>                                                 <td colspan="6" class="bordo_menu" align="center" height="430">                                                     <?                                                       if (isset($_GET['pagina']) && $_GET['pagina'] == "logon") {                                                        callSezione('../paginephp/form_login.php');                                                      }elseif (isset($_GET['pagina']) && $_GET['pagina'] == "welcome"){                                                        callSezione('../paginephp/home.php');                                                      }elseif (isset($_GET['pagina']) && $_GET['pagina'] == "changepassword"){                                                        callSezione('../paginephp/form_change_password.php');                                                      }elseif (isset($_GET['pagina']) && $_GET['pagina'] == "$pagina"){                                                        callSezioneFromDB($sezionedb);                                                        }else{                                                        echo "<span class=\"red\"> [b]<u>ATTENZIONE:</u>[/b] Nessuna pagina caricata, variabile GET non passata correttamente. </span>";                                                      }                                                     ?>                                                  </td>                                            </tr>                                            <?                                                 callSezione ('../includephp/footer.php');                                            ?> </body> </html>