Visualizzazione dei risultati da 1 a 3 su 3

Discussione: PRoblemi con notice!

  1. #1

    PRoblemi con notice!

    ragazzi ho un if che mi fa morire...

    con il seguente errore

    Notice: Undefined index: chk in S:\Edo\***\***.php on line 9

    il codice è..



    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <script language = "PHP" >
    $chk = $_POST["chk"];
    </script>
    <script language = "PHP" >

    if ( ($chk == '1') )
    {
    $nome1 = $_POST["nome"];
    $cognome1 = $_POST["cognome"];
    if ( ($nome1 == 'a' ) && ($cognome1 == 'a') )
    {
    print("$nome1\n");
    print ("$cognome1");
    }
    else
    {
    print("Password Errata");
    }
    }

    </script>
    <form name="form1" method="post" action="prova.php">
    <table width="155" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td height="29">
    <input type="text" name="nome">
    <font color="#FFFFFF"></font> </td>
    </tr>
    <tr>
    <td><input type="text" name="cognome">
    </td>
    </tr>
    <tr><input type="hidden" name="chk" value= "1">
    <td><input type="submit" name="Submit" value="Invia">
    </td>
    </tr>
    </table>
    </form>

    </body>
    </html> :maLOL: :maLOL: :maLOL: :maLOL: :maLOL: :maLOL:
    No ASP? NO PARTY!

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    212
    codice:
    <?php
    if (isset($_POST["chk"])) {
        $chk = $_POST["chk"];
    } else {
        $chk = 0;
    }
    ?>

  3. #3
    Grazie mille risolto...ma che casino...nn ci avevo pensato..grazie..
    No ASP? NO PARTY!

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.