<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Conflitto tra header e sessione....?????]]></title><description><![CDATA[<p dir="auto">Questa è una parte del mio codice, è una pagina di login con controllo di username e password, utilizzando poi le sessioni. Da n form inserisco login e password che, confrontate con quelle nel database, portano a una pagina login_success.php se corrette, o richiede di nuovo l'inserimento se errate.<br />
L'errore che mi viene fuori è: Warning: Cannot modify header information - headers already sent by (output started at c:\programmi\easyphp1-8\www\login.php:12) in c:\programmi\easyphp1-8\www\login.php on line 88 e dipende tutto dalla riga<br />
header("location:login_success.php"); ...sapete perchè o come posso fare per risolvere il problema? grazie!! <img src="http://forum.html.it/forum/images/smilies/confused.gif" alt="" class="img-markdown  img-fluid" /></p>
<p dir="auto">alla linea 12 ho i tag &lt;meta&gt;.... <img src="http://forum.html.it/forum/images/smilies/confused.gif" alt="" class="img-markdown  img-fluid" /><br />
Ho visto che header non vuole output prima della chiamata ma se devo metterla a quel punto del file come posso fare?<br />
cmq invio tutto il file:</p>
<p dir="auto"><em>&lt;?</em><br />
<em>session_start();</em><br />
<em>?&gt;</em></p>
<p dir="auto"><em>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"</em><br />
<em>"<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd" rel="nofollow ugc">http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd</a>"&gt;</em><br />
<em>&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" rel="nofollow ugc">http://www.w3.org/1999/xhtml</a>" xml:lang="it" &gt;</em><br />
<em>&lt;head&gt;</em><br />
<em>&lt;meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /&gt;</em><br />
<em>&lt;meta name="author" content="Riccardo Campopiano Simone Panizzi" /&gt;</em><br />
<em>&lt;meta name="keywords" content="parole chiave" /&gt;</em><br />
<em>&lt;link href="schermo.css" type="text/css" rel="stylesheet" media="screen" /&gt;</em></p>
<p dir="auto"><em>&lt;title&gt;Parole in libertà&lt;/title&gt;</em></p>
<p dir="auto"><em>&lt;/head&gt;</em></p>
<p dir="auto"><em>&lt;body&gt;</em></p>
<p dir="auto"><em>&lt;div id="intestazione"&gt; &lt;/div&gt;</em></p>
<p dir="auto"><em>&lt;div id="menu"&gt;</em><br />
<em>&lt;ul class="indice"&gt;</em><br />
<em>&lt;li&gt; &lt;a class="link" href="index.php"&gt; home &lt;/a&gt; &lt;/li&gt;</em><br />
<em>&lt;li&gt; &lt;a class="link" href="invio.php"&gt; invio opera &lt;/a&gt; &lt;/li&gt;</em><br />
<em>&lt;li&gt; &lt;a class="link" href="autore.php"&gt; autore &lt;/a&gt; &lt;/li&gt;</em><br />
<em>&lt;li&gt; &lt;a class="link" href="genere.php"&gt; genere &lt;/a&gt; &lt;/li&gt;</em><br />
<em>&lt;li&gt; &lt;a class="link" href="soggetto.php"&gt; soggetto &lt;/a&gt; &lt;/li&gt;</em><br />
<em>&lt;li&gt; &lt;a class="link" href="eventi.php"&gt; eventi &lt;/a&gt; &lt;/li&gt;</em><br />
<em>&lt;/ul&gt;</em></p>
<p dir="auto"><em>&lt;div id="piede" style="position:relative"&gt;</em></p>
<p dir="auto"><em>&lt;a class="link2" href="login.php"&gt; Effettua il login &lt;/a&gt;</em><br />
<em>&lt;br /&gt;</em><br />
<em>&lt;a class="link2" href="registrazione.php"&gt; Registrati &lt;/a&gt;</em></p>
<p dir="auto"><em>&lt;/div&gt;</em></p>
<p dir="auto"><em>&lt;/div&gt;</em></p>
<p dir="auto"><em>&lt;div id="corpo"&gt;</em></p>
<p dir="auto"><em>&lt;?</em></p>
<p dir="auto"><em>if (isset($_POST['submit'])) { }</em></p>
<p dir="auto"><em>else {</em></p>
<p dir="auto"><em>echo "&lt;h3&gt;Form di login&lt;/h3&gt;";</em><br />
<em>echo "&lt;FORM name=formreg action=login.php method=post&gt;";</em><br />
<em>echo "&lt;p&gt;&lt;span&gt;login&lt;br/&gt;";</em><br />
<em>echo "&lt;input name=login size=30/&gt;&lt;/span&gt;&lt;/p&gt;";</em><br />
<em>echo "&lt;p&gt;&lt;span&gt;Password&lt;br/&gt;";</em><br />
<em>echo "&lt;input name=password type=password /&gt;&lt;/span&gt;&lt;/p&gt;";</em><br />
<em>echo "&lt;p&gt;&lt;span&gt;&lt;input type=submit value=INVIA name=submit /&gt;&lt;/span&gt;&lt;/p&gt;";</em><br />
<em>echo "&lt;/FORM&gt;";</em></p>
<p dir="auto"><em>}</em></p>
<p dir="auto"><em>include("connection.inc");</em></p>
<p dir="auto"><em>$dbname="utenti";</em></p>
<p dir="auto"><em>mysql_select_db('utenti',$conn);</em></p>
<p dir="auto"><em>$mylogin=$_POST['login'];</em><br />
<em>$mypassword=$_POST['password'];</em></p>
<p dir="auto"><em>$sql="SELECT * FROM registrati WHERE login='$mylogin' and password='$mypassword'";</em><br />
<em>$result=mysql_query($sql);</em></p>
<p dir="auto"><em>$count=mysql_num_rows($result);</em></p>
<p dir="auto"><em>if($count==1) {</em><br />
<em>// Register $myusername, $mypassword and redirect to file "login_success.php"</em><br />
<em>session_register("myusername");</em><br />
<em>session_register("mypassword");</em><br />
<em>header("location:login_success.php");</em><br />
<em>exit();</em><br />
<em>}</em><br />
<em>else {</em><br />
<em>echo "Attenzione username o password errati";</em><br />
<em>}</em></p>
<p dir="auto"><em>?&gt;</em></p>
<p dir="auto"><em>&lt;/div&gt;</em><br />
<em>&lt;/body&gt;</em><br />
<em>&lt;/html&gt;</em></p>
<p dir="auto"><img src="http://forum.html.it/forum/images/smilies/dho.gif" alt="" class="img-markdown  img-fluid" /></p>
]]></description><link>https://dev.connect.gt/topic/47284/conflitto-tra-header-e-sessione</link><generator>RSS for Node</generator><lastBuildDate>Mon, 30 Nov 2026 02:30:27 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/47284.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Sep 2007 10:24:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Conflitto tra header e sessione....????? on Tue, 18 Sep 2007 12:05:50 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><strong>Skyline</strong></p>
<p dir="auto">la pagina è salvata con la codifica ANSI o ISO...? dev'essere ANSI</p>
</blockquote>
<p dir="auto">si. è ANSI...qualche idea sul perchè dell'errore?</p>
]]></description><link>https://dev.connect.gt/post/602949</link><guid isPermaLink="true">https://dev.connect.gt/post/602949</guid><dc:creator><![CDATA[nonnocavallo]]></dc:creator><pubDate>Tue, 18 Sep 2007 12:05:50 GMT</pubDate></item><item><title><![CDATA[Reply to Conflitto tra header e sessione....????? on Tue, 18 Sep 2007 11:05:33 GMT]]></title><description><![CDATA[<p dir="auto">la pagina è salvata con la codifica ANSI o ISO...? dev'essere ANSI</p>
]]></description><link>https://dev.connect.gt/post/602938</link><guid isPermaLink="true">https://dev.connect.gt/post/602938</guid><dc:creator><![CDATA[skyline]]></dc:creator><pubDate>Tue, 18 Sep 2007 11:05:33 GMT</pubDate></item></channel></rss>