<?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[Php-Header-Dreamweaver cs3]]></title><description><![CDATA[<p dir="auto">Salve dopo un ennesimo tentativo di risolvere un problema di "header" non mi resta che chiedere aiuto agli utenti di questo forum visto che sono tre mesi che ci provo senza risultati; ossia ho creato una pagina index di cui ho integrato un box di login, ma ogni volta che provo il form questo non mi reindirizza alla pagina voluta ma bensì ritorna alla index mostrandomi un errore sugli "header". Chiedo cortesemente se qualcuno mi può aiutare a riscrivere il form per evitare l'errore. Posto qui il codice:<br />
(NB: devo informarVi che sono piuttosto negato in Php e, se non vi dispiace, dove dovrei mettere le modifiche esattamente nel codice sottostante)</p>
<p dir="auto">&lt;?php session_start();?&gt;<br />
&lt;?php virtual('/Connections/conn.php'); ?&gt;<br />
&lt;?php<br />
if (!function_exists("GetSQLValueString")) {<br />
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")<br />
{<br />
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;</p>
<p dir="auto">$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);</p>
<p dir="auto">switch ($theType) {<br />
case "text":<br />
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />
break;<br />
case "long":<br />
case "int":<br />
$theValue = ($theValue != "") ? intval($theValue) : "NULL";<br />
break;<br />
case "double":<br />
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";<br />
break;<br />
case "date":<br />
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />
break;<br />
case "defined":<br />
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;<br />
break;<br />
}<br />
return $theValue;<br />
}<br />
}<br />
?&gt;<br />
&lt;?php<br />
// *** Validate request to login to this site.<br />
if (!isset($_SESSION)) {<br />
session_start();<br />
}</p>
<p dir="auto">$loginFormAction = $_SERVER['PHP_SELF'];<br />
if (isset($_GET['accesscheck'])) {<br />
$_SESSION['PrevUrl'] = $_GET['accesscheck'];<br />
}</p>
<p dir="auto">if (isset($_POST['Username'])) {<br />
$loginUsername=$_POST['Username'];<br />
$password=$_POST['Password'];<br />
$MM_fldUserAuthorization = "";<br />
$MM_redirectLoginSuccess = "/utente/login_ok.php";<br />
$MM_redirectLoginFailed = "/utente/error_login.php";<br />
$MM_redirecttoReferrer = false;<br />
mysql_select_db($database_conn, $conn);</p>
<p dir="auto">$LoginRS__query=sprintf("SELECT username, user_password FROM utenti WHERE username=%s AND user_password=%s",<br />
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));</p>
<p dir="auto">$LoginRS = mysql_query($LoginRS__query, $conn) or die(mysql_error());<br />
$loginFoundUser = mysql_num_rows($LoginRS);<br />
if ($loginFoundUser) {<br />
$loginStrGroup = "";</p>
<p dir="auto">//declare two session variables and assign them<br />
$_SESSION['MM_Username'] = $loginUsername;<br />
$_SESSION['MM_UserGroup'] = $loginStrGroup;</p>
<p dir="auto">if (isset($_SESSION['PrevUrl']) &amp;&amp; false) {<br />
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];<br />
}<br />
header("Location: " . $MM_redirectLoginSuccess );<br />
}<br />
else {<br />
header("Location: ". $MM_redirectLoginFailed );<br />
}<br />
}<br />
?&gt;<br />
<em>&lt;------- da qui parte il codice HTML-------&gt;</em><br />
&lt;!DOCTYPE .....................w3.org/1999/xhtml"&gt;<br />
&lt;head&gt;<br />
<em>&lt;---escludo questo pezzo in quanto non importante per la risoluzione ---&gt;</em><br />
&lt;/div&gt;<br />
&lt;div id="Internal_login_b"&gt;<br />
&lt;form ACTION="&lt;?php echo $loginFormAction; ?&gt;" id="form1" name="form1" method="POST"&gt;<br />
&lt;table width="330" align="center"&gt;<br />
&lt;tr&gt;<br />
&lt;td scope="col"&gt;&lt;span class="Stile4"&gt;<br />
&lt;label for="Username"&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/label&gt;<br />
&lt;/span&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input name="Username" type="text" id="Username" maxlength="20" /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td scope="col"&gt;&lt;label for="Password"&gt;&lt;span class="Stile3"&gt;Password&lt;/span&gt;&lt;/label&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;input name="Password" type="password" id="Password" maxlength="20" /&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td colspan="2"&gt;&lt;div align="center"&gt;<br />
&lt;input type="submit" name="button" id="button" value="Login" /&gt;<br />
&lt;/div&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&lt;/form&gt;<br />
&lt;/div&gt;</p>
<p dir="auto">Grazie in anticipo del Vostro aiuto.<br />
By Arkom</p>
]]></description><link>https://dev.connect.gt/topic/101226/php-header-dreamweaver-cs3</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 14:20:05 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/101226.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 May 2009 15:25:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Php-Header-Dreamweaver cs3 on Mon, 11 May 2009 15:51:59 GMT]]></title><description><![CDATA[<p dir="auto">Ciao,<br />
presumo che l'errore che ti segnala è la presnza di un output precedente al tentativo di eseguire il redirect.<br />
Il motivo è che questa porzione di codice:</p>
<pre><code class="language-php">&lt;?php session_start();?&gt;
&lt;?php virtual('/Connections/conn.php'); ?&gt;
&lt;?php
if (!function_exists("GetSQLValueString")) {
...
</code></pre>
<p dir="auto">genera un output, ovvero due "ritorno a capo", uno ciascuno dopo la chiusura dei tag php <strong>?&gt;</strong><br />
Modifica così:</p>
<pre><code class="language-php">&lt;?php session_start(); 
 virtual('/Connections/conn.php');
if (!function_exists("GetSQLValueString")) {
...
</code></pre>
<p dir="auto">o così:</p>
<pre><code class="language-php">&lt;?php session_start();?&gt;&lt;?php virtual('/Connections/conn.php'); ?&gt;&lt;?php
if (!function_exists("GetSQLValueString")) {
...
</code></pre>
<p dir="auto">La prima soluzione è decisamente migliore.<br />
Inoltre verifica che Connections/conn.php non generi un output.</p>
<p dir="auto">Alessandro</p>
]]></description><link>https://dev.connect.gt/post/829788</link><guid isPermaLink="true">https://dev.connect.gt/post/829788</guid><dc:creator><![CDATA[magicale]]></dc:creator><pubDate>Mon, 11 May 2009 15:51:59 GMT</pubDate></item></channel></rss>