<?
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
if($_GET){
echo $_GET['username'];
exit();
}
}
?>
<html>
<head>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script>
$(document).ready(function(){
$('#button').click(function(){
$user= $('#username').val();
$pass= $('#password').val();
$.get('test.php',{username:$user,password:$pass},function(data){
$('#myDiv').html(data)
})
})
})
</script>
</head>
<body>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<input type="text" id="username" name="username">
<input type="text" id="password" name="password">
<button type="button" id="button">Change Content</button>
<?php echo $_GET['username']; ?>
</body>
</html>
this is my simple logic ajax code, i want to $_GET['username'] to placed in
html(client-side) or otherwise any give ideas