<?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[Problemi con login]]></title><description><![CDATA[<p dir="auto">Girovagando su internet ho trovato una chat semplice semplice in PHP con database.</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">Tabella DB</p>
<pre><code>CREATE TABLE `chat` (
`TIME` TEXT NOT NULL ,
`UTENTE` TEXT NOT NULL ,
`POST` TEXT NOT NULL
);
</code></pre>
<p dir="auto">Funziona bene. Per il nick c' è un funzione in javascript che a me non piace. Vorrei creare un login con inserimento nick, senza cookies, ecc,,, (senza reg) e che poi quel nick inserito deve uscire come autore quando scrivo messaggi in chat. Non riesco uff...Mi aiutate??</p>
]]></description><link>https://dev.connect.gt/topic/167492/problemi-con-login</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 02:03:16 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/167492.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Mar 2012 17:36:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problemi con login on Thu, 08 Mar 2012 22:00:31 GMT]]></title><description><![CDATA[<p dir="auto">Grazie Mille! Saresti gentile da farmi il login a parte??</p>
]]></description><link>https://dev.connect.gt/post/1057318</link><guid isPermaLink="true">https://dev.connect.gt/post/1057318</guid><dc:creator><![CDATA[ralph007]]></dc:creator><pubDate>Thu, 08 Mar 2012 22:00:31 GMT</pubDate></item><item><title><![CDATA[Reply to Problemi con login on Thu, 08 Mar 2012 20:43:47 GMT]]></title><description><![CDATA[<p dir="auto">Vedi se funziona così<br />
Sicuramente ci sarà da modificare e adattare qualcosina.</p>
<pre><code class="language-php">&lt;?php
session_start();
include 'config2.php';
?&gt;
&lt;/head&gt;
&lt;body&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

if(isset($_POST['nick']) &amp;&amp; !empty($_POST['nick']) ){
 $_SESSION['nick'] = htmlentities(addslashes($_POST['nick']));
}

if(isset($_SESSION['nick'])){

$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;" ;
 }
} else {
 echo '&lt;form method="post" action="?set=nick"&gt;
 Inserisci il tuo nickname per la chat: &lt;input type="text" name="nick" value=""&gt;
 &lt;input type="submit" value=" accedi alla chat "&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($_SESSION['nick']); ?&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>
]]></description><link>https://dev.connect.gt/post/1057314</link><guid isPermaLink="true">https://dev.connect.gt/post/1057314</guid><dc:creator><![CDATA[ldgweb]]></dc:creator><pubDate>Thu, 08 Mar 2012 20:43:47 GMT</pubDate></item></channel></rss>