Warning: Cannot modify header information - headers already sent by (output started a

mailok

Nuovo Utente
1 Nov 2006
10
0
0
Ciao a tutti....
io e il php non abbiamo un buon rapporto....quindi avro' diversi quesiti da porvi ..spero non troppo banali vista la mia impreparazione sull argomento!!!

1)Session....se è possibile avere un esempietto semplice...
che esplichi cio'.... :)

2) Tento di ridirigere l'utente in un altra pagina con
header("location : http......")
mi salta fuori un errore che l'header è gia' stato mandato!!?????

Warning: Cannot modify header information - headers already sent by (output started at .............e poi va beh la path del codice...

H E L P M E!
 

puzz

Nuovo Utente
3 Nov 2006
3
0
0
www.phpwebdir.com
1)Session....se è possibile avere un esempietto semplice...
che esplichi cio'.... :)

2) Tento di ridirigere l'utente in un altra pagina con
header("location : http......")
mi salta fuori un errore che l'header è gia' stato mandato!!?????

1)

test1.php:

<?php

session_start();
$_SESSION[ "test" ] = "qwertz";

?>

test2.php:

<?php

session_start();
print "From session:" . $_SESSION[ "test" ];

?>

2) Guarda bene se nei tuoi script php non ci sono degli newline di troppo al inizio oppure alla fine delle script. E una buona idea non mettere ?> alla fine (si puo fare). Quindi invece di:

---------------------
<?php
session_start();
$_SESSION[ "test" ] = "dsjkldjsk";
?>
---------------------

Si puo comodamente scrivere:
---------------------
<?php
session_start();
$_SESSION[ "test" ] = "dsjkldjsk";
---------------------

(Senza il ?> di fine php script).
 
Discussioni simili
Autore Titolo Forum Risposte Data
G [PHP] Warning: Cannot modify header information - headers already sent by PHP 3
H Warning: Cannot modify header information... PHP 6
L Warning: Cannot modify header information - headers already sent by... PHP 9
H Warning: session_start() [function.session-start]: Cannot send session cache limiter PHP 8
M Warning: session_start(): Cannot send session cache... ???? PHP 5
F [MySQL] Warning 1265 data truncated for column... MySQL 5
B Warning: mysql_connect(): Access denied for user 'DIREZIONE'@'81.88.55.179' (using password: YES) PHP 6
G [PHP] Problema - Warning: session_start() [function.session-start] PHP 9
G Warning: mysql_num_rows() che problema è? PHP 3
P Warning: mysqli_query() expects parameter 1 to be mysqli PHP 2
C ERRORE: Warning: move_uploaded_file()... come risolverlo? PHP 1
JackIlPazzo Warning: Invalid argument supplied for foreach() PHP 1
N warning su sessione PHP 2
F Warning: Invalid argument supplied for foreach() PHP 3
A Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given PHP 17
L Problema messaggio d'errore -Warning: mysqli_num_rows() expects parameter 1 to be mysqli_ etc etc... PHP 2
pup3770 Su Mac funziona - su windows da warning PHP 9
E Warning: session_start() PHP 1
P Warning: mysql_num_rows() expects parameter 1 to be resource, array given in PHP 9
A Warning: mysql_result() expects parameter 1 to be resource, boolean given MySQL 2
I Warning: Division by zero in Joomla 0
S Help : Warning: mail() [function.mail] PHP 2
P Warning email() PHP 116
catellostefano CLASSE PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource PHP 2
Frank10 Problema w3c warning HTML5 -.-" HTML e CSS 5
neo996sps Warning su redirect della pagina PHP 9
M Warning: mysql_query() expects parameter 2 to be resource, boolean given PHP 3
S Warning sulle sessioni, come fare? PHP 1
catellostefano Problema per richiamare file xml -- Warning: DOMDocument::load() [domdocument.load]: PHP 0
L Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in .... PHP 2
S errore warning mysql_ferch_array() e mysql_free_result() PHP 5
A Warning strano PHP 2
JellyBelly Warning Uso Rename PHP 2
W Warning: main(./WEB-INF/etc/config.php): PHP 3
M Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in PHP 6
C problema con un warning PHP 0
L Error Code: 1215. Cannot add foreign key constraint MySQL 3
M non static method cannot be referenced from a static context Java 1
M Errore pagina php 'Cannot detect primary key' PHP 8
G Errore Cannot read property 'childNodes' of undefined per mancanza nodo nel file xml XML 6
romeocharly [WordPress] .../ffmpeg/ffmpeg32.so: cannot execute binary file" WordPress 11
A Errore: cannot call methods on dialog prior to initialization; attempted to call method 'open' jQuery 4
JackIlPazzo Cannot add foreign key constraint MySQL 1
J Errore the value cannot be null or empty ASP.NET 1
Nik Cannot send session cache limiter - ERRORE utilizzando session_start(); PHP 3
L Error: int cannot be dereferenced Java 1
filippino Fatal error: Cannot redeclare (function) PHP 2
L Cannot find executable for CFBundle Sviluppo app per iOS 0
L ITSM-9000 the bundle identifier cannot be changed from the current value Sviluppo app per iOS 0
D Cannot find XELDZ in all drives Windows e Software 0

Discussioni simili