Ciao a tutti....
mi potete dare dei consigli....

1)codice:
Codice PHP:
function CreateXmlHttpReq(handler){
var
xmlhttp = null;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = handler;
return
xmlhttp;
}

function
myHandler(){
if(
Ajax.readyState == 4 && Ajax.status == 200) {
document.getElementById("discussione").innerHTML = Ajax.responseText;
}}

function
Ricevi() {
Ajax = CreateXmlHttpReq(myHandler);
Ajax.open("GET","message.php");
Ajax.send(null);
}
window.setInterval("Ricevi()", 2000);
vorrei sostituire questa parte
Codice PHP:
function CreateXmlHttpReq(handler){
var
xmlhttp = null;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = handler;
return
xmlhttp;
}
con questa cosa deve aggiungere nel codice per far si che funzioni con tutti i tipi di browser...
Codice PHP:
function HttpAjax(){
var
xmlHttp;
try{
//Firefox, Opera e Safari
xmlHttp=new XMLHttpRequest();
}
catch(
exc){
//Internet Explorer
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(
exc){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(
exc){
alert("Il tuo Browser non supporta AJAX.");
return
false;
}}}
return
xmlHttp;
}
2)codice:
Codice PHP:
function Uscita(){
var conferma=confirm("Stai Uscendo veramente!!");
if(conferma == true){
location.href = "logout.php?nickname=<?php echo $_COOKIE['nickname']; ?>";
}else{
alert("Chiusura annullata.");
}}
Codice PHP:
<a onclick="Uscita();" href=""><font color="#FF0000">Esci</font></a>
cliccando su un pulsante dovrebbe chiedere la conferma del uscita del utente se clicca su si l'utente dovrebbe uscire vi posto il file logout....
Codice PHP:
<?php
require("config.php");
$nickname = $_GET['nickname'];
setcookie('nickname',"",time() - 3600);
if(!isset(
$_COOKIE['nickname'])){
mysql_query("DELETE FROM utenti WHERE nickname = '$nickname'");
}
header("Location: login.php");
?>
dovrebbe cancellare il cookie del utente e dorrebbe eliminarlo dal db....
ma non funziona.....
l'utente non esce....

3)codice:
Codice PHP:
function CreateXmlHttpReq(handler){
var
xmlhttp = null;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = handler;
return
xmlhttp;
}

function
myHandler(){
if(
Ajax.readyState == 4 && Ajax.status == 200) {
document.getElementById("discussione").innerHTML = Ajax.responseText;
}}

function
Ricevi() {
Ajax = CreateXmlHttpReq(myHandler);
Ajax.open("GET","message.php");
Ajax.send(null);
}

function
Handler2(){
if(
Ajax.readyState == 4 && Ajax.status == 200) {
document.getElementById("online").innerHTML = Ajax.responseText;
}}
function
Online() {
Ajax = CreateXmlHttpReq(Handler2);
Ajax.open("GET","online.php");
Ajax.send(null);
}
window.setInterval("Ricevi()", 2000);
window.setInterval("Online()", 2000);
vorrei aggiornare un altro campo con id online...
pero il problema e che sia nel id online e discussione mi visualizza gli utenti online perché....

4)vorrei che si posizionasse alla fine del div....
nella pagina message.php avevo messo...
Codice PHP:
<script type="text/javascript">
function
scendi(){
window.location.href = "#fondo";
}
window.setTimeout("scendi()",5000);
</script>

<div id="fondo"></div>
come posso fare....

Ringrazio del Aiuto...^^