Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 15
  1. #1

    [form] incomunicabilità di dati in locale

    I due file sotto elencati dovrebbero interagire tra di loro ma nella mia locale non lo fanno, sul mio hosting funzionano perfettamente:

    File .html:

    <html>
    <head>
    <title>Listing 9.2 A simple HTML form</title>
    </head>
    <body>
    <form action="0903.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>


    file .php:

    <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>

    Chi sa darmi una mano?

    GRAZIE!!!

  2. #2
    nel file .php
    $_GET['user'];
    $_GET['address'];

  3. #3
    CONTINUA A NON FUNZIONARE IN LOCALE!!!

    Oltretutto se eseguo il form premendo SUBMIT, invece di eseguirlo cerca di scaricarmi il file .php... VVoVe:

    PAZZESCO!!!

    Qualche altra idea???

  4. #4
    prova a cambiare il method del form.
    method="post"

    e nella seconda pagina:
    $user=$_POST['user'];
    $address=$_POST['address'];
    echo"utente $user
    address $address";

  5. #5
    Purtroppo ho già provato ed il risultato è lo stesso.

    Sul mio hosting esterno funziona correttamente, IN LOCALE NON MI CAGA DI STRISCIO!!! ovvero, il comando print lo riconosce e lo elabora ma non riesce a raccogliere i dati che arrivano dal form.

    Ripeto: questa anomalia si presenta quando lavoro in locale, quindi presuppongo che sia un settaggio sul mio PC che incasina le cose.


    HELP

  6. #6
    ma in locale c'è l'hai installato il php?

  7. #7
    Sì, ho (per lo meno a quanto vedo io) istallato tutto correttamente.

    Prima il server Apache, poi il PHP versione 4.2.3 (l'ho letto eseguendo il file phpinfo.php) e poi il MySQL.

    Ho già fatto delle prove e sembrava funzionare tutto fino a quando ho tentato di far dialogare un form con un file .php: NON C'E' VERSO!!!



    HELP ME PLEASE!!!

  8. #8
    non è possibile...è cosi semplice....!
    forse sbagli qualcosa nello script.
    Postalo!

  9. #9
    File 0902.htm

    <html>
    <head>
    <title>Listing 9.2 A simple HTML form</title>
    </head>
    <body>
    <form action="0903.php" method="post">
    <input type="text" name="user">


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


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


    File 0903.php

    <html>
    <head>
    <title>Listing 9.3 Reading input from the form in Listing 9.2</title>
    </head>
    <body>
    <?php

    $_POST['user'];
    $_POST['address'];

    print "Welcome $user

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

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


    Come puoi vedere ho anche messo $_POST nell'ultimo script, e ripeto che non funziona SOLO IN LOCALE perchè sul mio hosting FUNZIONA PERFETTAMENTE!!!
    :master:

    THANKS!!!

  10. #10
    fai cosi e vedi se funziona...
    attenzione ai nomi delle pagine

    pagina1.php
    [CODE]<form method="post" action="/pagina2.php">
    user

    <input type="text" name="user">


    address

    <input type="text" name="address">


    <input type="submit" value="invia">
    </form>CODE]

    pagina2.php
    Codice PHP:
    <?
    $user
    =$_POST['user'];
    $address=$_POST['address'];
    echo
    "$user
    $address";
    ?>
    dovrebbe funzionare...!

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.