Visualizzazione dei risultati da 1 a 7 su 7

Discussione: $_post ?

  1. #1

    $_post ?

    Vorrei usare $_POST con un mio campo..

    In pratica vorrei cambiare una variabile se è presente o meno un post, da me inventato.

    Ho provato:

    Codice PHP:
    if ( $_POST['postattivo'] == si ) {
    $var 'attivo';
    }
    else { 
    $var 'inattivo'; } 
    Nn funziona .......
    Main: Asus P5KR | Intel Q6600 G0 @ 3.6GHz | Kingston 2x1GB DDR-II @ 800MHz | POV GeForce 8800GT 512MB | Seagate Barracuda 7200.11 32MB 2x500GB RAID0 | Enermax Chakra 3052BS | Enermax Liberty 500W | Zerotherm Nirvana NV120 Premium || eee PC || Net: Atlantis Land WebShare 340 | Alice 19M/1M || Gentoo Linux | gtk-gnutella rulezz.

  2. #2
    Codice PHP:
    if ( $_POST['postattivo'] == "si" ) { 
    è una stringa...

  3. #3
    Ciao

    non ho ben capito cosa vuoi ottenere.
    prova così:

    if (empty($_POST['postattivo']))
    {
    ...
    }
    else
    {
    ...
    }
    empty controlla se il tuo campo e' vuoto.

  4. #4
    Uhm ..

    non funziona ...

    Codice PHP:
    if (empty($_POST['a'])) {
    $var "a vuoto";
    }
    else {
    $var "a pieno";

    Restituisce "a vuoto"

    Se digito

    www.example.com/index.php?a=quelloketipare


    Main: Asus P5KR | Intel Q6600 G0 @ 3.6GHz | Kingston 2x1GB DDR-II @ 800MHz | POV GeForce 8800GT 512MB | Seagate Barracuda 7200.11 32MB 2x500GB RAID0 | Enermax Chakra 3052BS | Enermax Liberty 500W | Zerotherm Nirvana NV120 Premium || eee PC || Net: Atlantis Land WebShare 340 | Alice 19M/1M || Gentoo Linux | gtk-gnutella rulezz.

  5. #5
    forse lo devi passare tramite $_GET[a]

  6. #6
    $_get si usa per la query string...
    $_post si usa per i moduli


  7. #7
    Opss!

    Ci avevo pensato ma poi nulla di fatto..

    Grazie, ora riconosce il get..
    Main: Asus P5KR | Intel Q6600 G0 @ 3.6GHz | Kingston 2x1GB DDR-II @ 800MHz | POV GeForce 8800GT 512MB | Seagate Barracuda 7200.11 32MB 2x500GB RAID0 | Enermax Chakra 3052BS | Enermax Liberty 500W | Zerotherm Nirvana NV120 Premium || eee PC || Net: Atlantis Land WebShare 340 | Alice 19M/1M || Gentoo Linux | gtk-gnutella rulezz.

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.