<?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[Problema con login e database]]></title><description><![CDATA[<p dir="auto">Allora, vi spiego la mia situazione. Ho creato un form di registrazione e un form di login.<br />
Queste sono le tabelle del form di registrazione...</p>
<pre><code>CREATE TABLE `my_database`.`utenti_temp` (
`codiceconferma` VARCHAR( 100 ) NOT NULL ,
`username` VARCHAR( 60 ) NOT NULL ,
`password` VARCHAR( 100 ) NOT NULL ,
`email` VARCHAR( 60 ) NOT NULL
) ENGINE = MYISAM
</code></pre>
<pre><code>CREATE TABLE `my_database`.`utenti` (
`id` INT NOT NULL AUTO_INCREMENT ,
`username` VARCHAR( 60 ) NOT NULL ,
`password` VARCHAR( 100 ) NOT NULL ,
`email` VARCHAR( 60 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM
</code></pre>
<p dir="auto">Se il login è corretto mi porta in chat. E fin qui tutto bene.</p>
<p dir="auto">ho creato questa tabella per la chat</p>
<pre><code>CREATE TABLE `chat` (
`TIME` TEXT NOT NULL ,
`UTENTE` TEXT NOT NULL ,
`POST` TEXT NOT NULL
);
</code></pre>
<p dir="auto">Il problema che io una volta fatto il login i messaggi che scrivo in chat devono essere inviati con il nick con cui ho fatto il login. Per ora c' è un input in javascript. Ecco la chat</p>
<pre><code>&lt;?php
include 'config2.php'
?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script&gt;apertura_pagina();&lt;/script&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;table border=0 align=center id="tabella" height=200px width=500px&gt;
&lt;tr&gt;
&lt;td style="font-size:13px" valign=top&gt;
&lt;div style="overflow: auto;width: 100%; height: 175px"&gt;
&lt;?php

$query = mysql_query("SELECT * FROM `chat` ORDER BY `TIME` ASC");

while($result = mysql_fetch_array($query)) {
print "&lt;b&gt;".$result['UTENTE']." : &lt;/b&gt; ".$result['POST']." &lt;br&gt;" ;
}
?&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height=25px style="border-color:grey;"&gt;
&lt;form action="" method="POST" style="margin:0px;padding=0px;"&gt;
&lt;input type="text" name="testo" style="width: 430px; border-style:solid; background-color:grey;" /&gt;
&lt;input type="hidden" name="utente" value="&lt;?php print htmlspecialchars(@$_COOKIE['nome_utente']); ?&gt;" /&gt;
&lt;input type="submit" name="submit" value="INVIA" style="border-style:solid; border-color:black;background-color:grey;" /&gt;
&lt;/form&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;?php
if(!empty($_POST['testo']) &amp;&amp; !empty($_POST['utente'])) {

$text = mysql_real_escape_string( htmlentities( stripslashes( $_POST['testo'] )));
$utente = mysql_real_escape_string( htmlentities( stripslashes( $_POST['utente'] )));

mysql_query("INSERT INTO `chat` (`TIME` ,`UTENTE` ,`POST`
)VALUES (
NOW( ), '{$utente}', '{$text}');");

print " &lt;script language='JavaScript'&gt;aggiorna()&lt;/script&gt; ";
}
?&gt;
</code></pre>
<p dir="auto">Grazie a tutti!</p>
]]></description><link>https://dev.connect.gt/topic/167441/problema-con-login-e-database</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 02:03:10 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/167441.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Mar 2012 20:46:59 GMT</pubDate><ttl>60</ttl></channel></rss>