Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. gregoryo
    3. Post
    G

    gregoryo

    @gregoryo

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 1
    • Post 3
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Località brescia Età 50
    0
    Reputazione
    3
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da gregoryo

    • RE: sessioni e array in php

      Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\sito\prova2.php:12) in C:\xampp\htdocs\sito\prova2.php on line 16

      postato in Coding
      G
      gregoryo
    • RE: sessioni e array in php

      hai ragione scusa,la sessione non parte dicendomi che nel file prova2 con errore nella riga 17 e 21 ma non so cosa fare

      postato in Coding
      G
      gregoryo
    • sessioni e array in php

      Ciao a tutti mi serve una mano per favore devo fare un piccolo sito dove mi autentico tramite un form che prende utente e password dopo l'autenticazione deve dirigermi su un'altra pagina e volendo faccio una pagina di logout. io sono riuscito ad arrivare fin qui ma mi rimanda degli errori.

      prova2.php
      <?php
      session_start();
      $dest = "protetta.php";
      $DButenti = array('mario' => 'passmario','rossi' => 'passrossi');
      if (isset($_GET[invio])){
      $utente = $_GET['utente'];
      $pass = $_GET['password'];
      if (isset($DButenti[$utente])){
      echo 'nome trovato<br>';
      if ($DButenti[$utente]==$pass){
      echo 'e password ok';
      header("Location: protetta.php");
      }
      else
      echo 'e password sbagliata';
      }
      else
      echo 'nome non trovato';
      }
      ?>
       
      <html>
      <head>
      <title>Immissione Password</title>
      <script type="text/javascript">
      function controllaDatiPassword() {
      if (document.formPasswd.utente.value == "") {
      alert("Inserire login");
      document.formPasswd.utente.focus();
      return false;
      }
      if (document.formPasswd.password.value == "") {
      alert("Inserire la password");
      document.formPasswd.password.focus();
      return false;
      }
      return true;
      }
      </script>

      <title>verificapassword.php</title>
      </head>
      <body bgcolor="#deccdf">
      <body>
      <hr size="2">
      <br>
      <center>
      <h1>Immetti le tue credenziali per poter entrare</h1>
      <form name="formPasswd" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="get" onSubmit="return controllaDatiPassword();">
      Utente <input type="text" name="utente"><br>
      Password <input type="password" name="password"><br>
      <input type="submit" name="invio" value="Invio">
      <input type="reset" name="reset" value="resetta">
      <hr>
      </form>
      </body>
      </html>

      file protetta
      <?php
      session_start();
       
      <html>
      <head>
      <title>Zona privata</title>
      </head>
      <body bgcolor="#deccdf">
      <center>
      <h1>Complimenti <? echo $_SESSION["prova2"]; ?> sei nella zona privata</h1>
      DATI PROTETTI......bla bla bla</a>
      <br>
      <a href="logout.php" >clicca per terminare la sessione</a>
      </center>
      </body>
      </htm

      Gentilmente ringrazio chi mi aiuta ho' la testa in fiamme.

      postato in Coding
      G
      gregoryo