Visualizzazione dei risultati da 1 a 3 su 3

Discussione: problema header

  1. #1
    Utente di HTML.it L'avatar di gaten
    Registrato dal
    Jul 2007
    Messaggi
    1,269

    problema header

    Allora io ho inserito un header funziona è un logj e se qualcuno fa il furmo mettendo www.gaten91.altervista.org/sito/pagina.html resce ad entrare nel sito senza fare il login questa è la pagina homepage.php cioè chi esegue correttamente il login lo porta alla pagina seguente cioè homepage.php ecco la pagina dove devo inserire header("location:sito/pagina.html"); però deve essere protetto cioè deve loggarsi e se fa il furbo non deve riuscirci



    <?php
    if (!isset($_SESSION)) {
    session_start();
    }
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";

    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
    // For security, start by assuming the visitor is NOT authorized.
    $isValid = False;

    // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
    // Therefore, we know that a user is NOT logged in if that Session variable is blank.
    if (!empty($UserName)) {
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
    // Parse the strings into arrays.
    $arrUsers = Explode(",", $strUsers);
    $arrGroups = Explode(",", $strGroups);
    if (in_array($UserName, $arrUsers)) {
    $isValid = true;
    }
    // Or, you may restrict access to only certain users based on their username.
    if (in_array($UserGroup, $arrGroups)) {
    $isValid = true;
    }
    if (($strUsers == "") && true) {
    $isValid = true;
    }
    }
    return $isValid;
    }

    $MM_restrictGoTo = "protezione_pagina.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
    $MM_qsChar = "?";
    $MM_referrer = $_SERVER['PHP_SELF'];
    if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
    if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
    $MM_referrer .= "?" . $QUERY_STRING;
    $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
    header("Location: ". $MM_restrictGoTo);
    exit;
    }
    ?><!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Documento senza titolo</title>
    <style type="text/css">
    <!--
    .Stile1 {font-family: "Arial Narrow"}
    -->
    </style>
    </head>

    <body>
    <span class="Stile1">Hello welcome to my site!</span>
    </body>
    </html>
    Con i sogni possiamo conoscere il futuro...

  2. #2
    Utente di HTML.it L'avatar di deleted_id_48586
    Registrato dal
    Nov 2002
    Messaggi
    1,732
    Non ho capito quale sia il problema, potresti spiegarti un pò meglio.

    Bada alla punteggiatura.

  3. #3
    Forse non hai capito e cercherò di spiegarmi meglio: NON PUOI aprire più discussioni sempre con la stessa domanda, ne hai già aperta una, questa e devi continuare lì, sono stato chiaro ?

    Questa è la seconda che ti chiudo, se ne apri una terza ti segnalo all'amministratore
    Addio Aldo, amico mio... [03/12/70 - 16/08/03]

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.