views:

43

answers:

1

Ive got an ajax type script changing div content with data from a PHP file using xmlhttp:

function updatelog() {
request = 'messages.php?new='+first+'&time='+lastupdate+'&user='+user;
xmlhttp.open("GET", request ,false);
xmlhttp.send();
document.getElementById("messages").innerHTML=document.getElementById("messages").innerHTML+xmlhttp.responseText;
lastupdate = time();
first = 0;
document.getElementById("messages-window").scrollTop = document.getElementById("messages-window").scrollHeight;
}

I want to redirect the user using header( 'Location: kick.php' ); but it only redirects the XML request, not the whole page. how can i redirect the whole page and not just the request?

+1  A: 

Use javascript redirect

window.location = "kick.php"

zod