Visualizzazione risultati 1 fino 4 di 4

Discussione: Area Membri

  1. #1
    Guest

    Predefinito

    questo codice dovrebbe farti accedere a un'area protetta del sito con username e password. Funziona il link alla pagina desiderata se la pass e user sono corretti. Solamente che se nn compilo i form o nn dgt dati corretti nn linka alla pagina di errore da me creata.
    IL codice è Questo:
    Il problema secondo me sta nelle parti evidenziate in rosso ma nn capisco
    come risolvere:
    //Pagine Protette
    $file1 = "blank.php"; //form nn compilati
    $file2 = "pass.php"; //password o Username errati
    $file3 = "index.htm"; //pagina prottetta

    //UserName a Passwords
    ################################################## ############################
    $username[1] = "pass"; // Generale
    $password[1] = "pass";

    $username[2] = ""; // utente1
    $password[2] = "";

    $username[3] = ""; // utente2
    $password[3] = "";

    $username[4] = ""; // utente3
    $password[4] = "";

    $username[5] = ""; // utente4
    $password[5] = "";

    $username[6] = ""; // utente5
    $password[6] = "";

    $username[7] = ""; // utente6
    $password[7] = "";

    $username[8] = ""; // utente7
    $password[8] = "";

    $username[9] = ""; // utente8
    $password[9] = "";

    $username[10] = ""; // utente9
    $password[10] = "";
    ################################################## ############################

    if (!$submit) {
    ?>
    <html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    <body bgcolor="#000000">
    <form action="<? $PHP_SELF ?>" method="GET">
    <p> </p>
    <p align="center"><img src="a.jpg" width="425" height="128"></p>
    <p align="center"> </p>
    <table width="300" align="Center" cellpadding="0" cellspacing="0" bgcolor="#000000" border="1" bordercolor="#000000">
    <tr><td bordercolor="#000000">
    <table border="0" align="Center" cellpadding="2" cellspacing="0" bordercolor="#000000">
    <tr>
    <td colspan="2" bgcolor="#000000"><div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><strong>Area riservata ai mebri dello staff </strong></font></div></td>
    </tr>
    <tr>
    <td colspan="2" bgcolor="#000000"> </td>
    </tr>
    <tr>
    <td width="268" bgcolor="#000000"><div align="center"><font color="#FFFFFF" size="-1" face="Verdana"><strong> Username:</strong></font></div></td>
    <td width="250" bgcolor="#000000"><input name="user" type="Text" size="10"></td>
    </tr>
    <tr><td bgcolor="#000000"><div align="center"><strong><font color="#FFFFFF" size="-1" face="Verdana">Password:</font></strong></div></td>
    <td bgcolor="#000000"><input name="pass" type="Password" size="10"></td>
    </tr>
    <tr bgcolor="#000000">
    <td colspan="2" align="center"> </td>
    </tr>
    <tr bgcolor="#000000"><td colspan="2" align="center"><input name="submit" type="submit" name="submit" value="Accedi">
    <div align="center"></div>
    <div align="center"></div></td>
    </tr>
    </table></td></tr></table>
    </form></body></html>
    <?
    } else {
    //controlla che i form nn siano vuoti
    if ($user == null || $pass == null) {
    include ("$file1");

    }
    //controlla correttezza pass
    else {
    if (
    $user == $username[1] && $pass == $password[1] ||
    $user == $username[2] && $pass == $password[2] ||
    $user == $username[3] && $pass == $password[3] ||
    $user == $username[4] && $pass == $password[4] ||
    $user == $username[5] && $pass == $password[5] ||
    $user == $username[6] && $pass == $password[6] ||
    $user == $username[7] && $pass == $password[7] ||
    $user == $username[8] && $pass == $password[8] ||
    $user == $username[9] && $pass == $password[9] ||
    $user == $username[10] && $pass == $password[10]
    ) {
    include ("$file3");
    }
    //password o username sbagliati
    else {
    include ("$file2");

    }
    }
    }
    ?>


    gRAZIE anticipatamente

  2. #2
    L'avatar di marcio
    marcio non è connesso AlterGuru 2500
    Data registrazione
    17-08-2003
    Residenza
    Palermo
    Messaggi
    3,300

    Predefinito

    puoi postare il codice dell'errore?

  3. #3
    Guest

    Predefinito

    prova con questo...
    [code:1:b0bbfaf6f4]<?
    $file1 = "blank.php"; //form nn compilati
    $file2 = "pass.php"; //password o Username errati
    $file3 = "index.htm"; //pagina prottetta

    //UserName a Passwords
    ################################################## ############################
    $username[1] = "pass"; // Generale
    $password[1] = "pass";

    $username[2] = ""; // utente1
    $password[2] = "";

    $username[3] = ""; // utente2
    $password[3] = "";

    $username[4] = ""; // utente3
    $password[4] = "";

    $username[5] = ""; // utente4
    $password[5] = "";

    $username[6] = ""; // utente5
    $password[6] = "";

    $username[7] = ""; // utente6
    $password[7] = "";

    $username[8] = ""; // utente7
    $password[8] = "";

    $username[9] = ""; // utente8
    $password[9] = "";

    $username[10] = ""; // utente9
    $password[10] = "";
    ################################################## ############################

    if (!$submit) {
    ?>
    <html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    <body bgcolor="#000000">
    <form action="<? $PHP_SELF ?>" method="GET">
    <p> </p>
    <p align="center"><img src="a.jpg" width="425" height="128"></p>
    <p align="center"> </p>
    <table width="300" align="Center" cellpadding="0" cellspacing="0" bgcolor="#000000" border="1" bordercolor="#000000">
    <tr><td bordercolor="#000000">
    <table border="0" align="Center" cellpadding="2" cellspacing="0" bordercolor="#000000">
    <tr>
    <td colspan="2" bgcolor="#000000"><div align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><strong>Area riservata ai mebri dello staff </strong></font></div></td>
    </tr>
    <tr>
    <td colspan="2" bgcolor="#000000"> </td>
    </tr>
    <tr>
    <td width="268" bgcolor="#000000"><div align="center"><font color="#FFFFFF" size="-1" face="Verdana"><strong> Username:</strong></font></div></td>
    <td width="250" bgcolor="#000000"><input name="user" type="Text" size="10"></td>
    </tr>
    <tr><td bgcolor="#000000"><div align="center"><strong><font color="#FFFFFF" size="-1" face="Verdana">Password:</font></strong></div></td>
    <td bgcolor="#000000"><input name="pass" type="Password" size="10"></td>
    </tr>
    <tr bgcolor="#000000">
    <td colspan="2" align="center"> </td>
    </tr>
    <tr bgcolor="#000000"><td colspan="2" align="center"><input name="submit" type="submit" value="Accedi">
    <div align="center"></div>
    <div align="center"></div></td>
    </tr>
    </table></td></tr></table>
    </form></body></html>
    <?
    } else if ($user == null || $pass == null) {
    include ("$file1");
    } else if (($user == $username[1]) && ($pass == $password[1]) || ($user == $username[2]) && ($pass == $password[2]) || ($user == $username[3]) && ($pass == $password[3]) || ($user == $username[4]) && ($pass == $password[4]) || ($user == $username[5]) && ($pass == $password[5]) || ($user == $username[6]) && ($pass == $password[6]) || ($user == $username[7]) && ($pass == $password[7]) || ($user == $username[8]) && ($pass == $password[8]) || ($user == $username[9]) && ($pass == $password[9]) || ($user == $username[10]) && ($pass == $password[10] )) {
    include ("$file3");
    } else {
    include ("$file2");
    }[/code:1:b0bbfaf6f4]

  4. #4
    Guest

    Predefinito

    la cosa interessa anche a me..quando si trove il codice esatto potete postarlo??grazie 1000

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •