Visualizzazione dei risultati da 1 a 3 su 3

Discussione: [php]Moduli

  1. #1

    [php]Moduli

    ho installato un server locale,per poter fare interagire php e my sql tramite apache.il problema è questo, sto studiando un manuale e sono arrivato al capitolo sui moduli.
    il modulo da creare è semplicemente questo:
    <html>
    <head>
    <title>Listing 9.2 A simple HTML form</title>
    </head>
    <body>
    <form action="eg9.3.php" method="GET">
    <input type="text" name="user">


    <textarea name="address" rows="5" cols="40">
    </textarea>


    <input type="submit" value="hit it!">
    </form>
    </body>
    </html>

    il file lettore dei dati è questo invece:
    <html>
    <head>
    <title>Listing 9.3 Reading input from the form in Listing 9.2</title>
    </head>
    <body>
    <?php
    print "Welcome $user

    \n\n";
    print "Your address is:

    \n\n$address";
    ?>
    </body>
    </html>

    però nn mi funziona, ovvero il file eg9.3 nn legge le variabili passate e stampa solo welcome e yor...
    un'altra cosa strana è che le variabili globali che il mio browser presenta nn sono tutte quelle che il libro cita:
    sono solo queste:
    $GLOBALS["HTTP_POST_VARS"] == Array
    $GLOBALS["_POST"] == Array
    $GLOBALS["HTTP_GET_VARS"] == Array
    $GLOBALS["_GET"] == Array
    $GLOBALS["HTTP_COOKIE_VARS"] == Array
    $GLOBALS["_COOKIE"] == Array
    $GLOBALS["HTTP_SERVER_VARS"] == Array
    $GLOBALS["_SERVER"] == Array
    $GLOBALS["HTTP_ENV_VARS"] == Array
    $GLOBALS["_ENV"] == Array
    $GLOBALS["HTTP_POST_FILES"] == Array
    $GLOBALS["_FILES"] == Array
    $GLOBALS["_REQUEST"] == Array
    $GLOBALS["GLOBALS"] == Array
    $GLOBALS["key"] == GLOBALS
    $GLOBALS["value"] == GLOBALS

  2. #2
    il file lettore dei dati è questo invece:
    <html>
    <head>
    <title>Listing 9.3 Reading input from the form in Listing 9.2</title>
    </head>
    <body>
    <?php
    $user=$_GET['user'];
    $address=$_GET['address'];
    print "Welcome $user

    \n\n";
    print "Your address is:

    \n\n$address";
    ?>
    </body>
    </html>


    prova così

  3. #3

    grazie

    l'ho provato e funziona,grazie mille

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 © 2024 vBulletin Solutions, Inc. All rights reserved.