Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 15 su 15
  1. #11
    Utente di HTML.it
    Registrato dal
    Aug 2009
    Messaggi
    18
    ok, su altervista tutto sembra ok, su altro server, tophost, ottengo 3 errori:

    codice:
    Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.MIOSITO.IT/htdocs/index.php:2) in /home/mhd-01/www.MIOSITO.IT/htdocs/index.php on line 3
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.MIOSITO.IT/htdocs/index.php:2) in /home/mhd-01/www.MIOSITO.IT/htdocs/index.php on line 4
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.MIOSITO.IT/htdocs/index.php:2) in /home/mhd-01/www.MIOSITO.IT/htdocs/index.php on line 5

  2. #12
    quel tipo di dati va messo prima di qualunque altro output
    quindi nel tuo caso prima del doctype

    cookie, sessioni e header ecc vanno sempre prima di tutto

    diverso, se stampi a vide oqualcosa, allora dopo il doctype

  3. #13
    Originariamente inviato da fabio079
    ok, su altervista tutto sembra ok, su altro server, tophost, ottengo 3 errori:

    codice:
    Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.MIOSITO.IT/htdocs/index.php:2) in /home/mhd-01/www.MIOSITO.IT/htdocs/index.php on line 3
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.MIOSITO.IT/htdocs/index.php:2) in /home/mhd-01/www.MIOSITO.IT/htdocs/index.php on line 4
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/mhd-01/www.MIOSITO.IT/htdocs/index.php:2) in /home/mhd-01/www.MIOSITO.IT/htdocs/index.php on line 5
    la comparsa degli errori dipende da com'è impostato il php.ini

    ci sono alcuni server che non stampano nessun errore
    se vuoi bloccare gli errori prova error_reporting(0); se il server ti fa modificare quel parametro

  4. #14
    Utente di HTML.it
    Registrato dal
    Aug 2009
    Messaggi
    18
    Grazie 1000 per le risposte

  5. #15
    Impostare l'error reporting su zero vuol dire nascondere (quindi non risolvere) gli errori: se su un hoster non si vedono e sull'altro si ... il codice rimane comunque errato!

    Il fatto che magari funzioni può dipendere da qualche configurazione specifica abilitata dall'hoster (leggasi output buffering abilitato da php per, ad esempio, abilitare la compressione dei dati in uscita), ma questo non vuol dire che il codice operi in modo corretto

    in generale l'error_reporting conviene tenerlo sempre abilitato al massimo livello cosi da poter risolvere TUTTI gli errori, quelli minori e quelli maggiori perché sono comunque entrambi errori (molti hanno la cattiva abitudine di scrivere codice con i NOTICE spenti con il risultato che dopo si scoprono strani problemi ... spesso derivanti da questo)

    error_reportin(E_ALL + E_NOTICE);

    The fastest Redis alternative ... cachegrand! https://github.com/danielealbano/cachegrand

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.