I am very new to this please help me with this.. i can display only name but i have to display age, dob also in index page as i have created input form
in check.php i can send only one data so how can i send age, dob also and how to get that in index page
index.php
<html>
<head>
<script type='text/javascript'>
function validate(field)
{
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() // Checking if readyState changes
{
if (xmlhttp.readyState==4 && xmlhttp.status==200) // Validation Completed
{
document.getElementById("name").value = xmlhttp.responseText;
}
}
xmlhttp.open("GET","check.php?field="+field+, false);
xmlhttp.send();
}
</script>
</head>
<body>
<form name="gt" id="gt" action="Form_Action.php" method="post" >
<table>
<tr>
<td>Userid</td>
<td><input type='text' name='userid' id='userid' onchange="validate( this.value)"></td>
<td></td></tr>
<tr><td>name</td>
<td><input type='text' name='name' id='name' ></td>
<td></td>
</tr>
<tr><td>age</td>
<td><input type='text' name='age' id='age'></td>
<td></td>
</tr>
<tr><td>dob</td>
<td><input type='text' name='dob' id='dob'></td>
<td></td>
</tr>
</table>
<input type='submit' value='Submit'>
</form>
</body>
</html>
check.php
<?php
include('connect.php');
$field= $_GET['field'];
$res=mysql_query("Select userid,name,age,dob from user where userid='$field' ");
while($row=mysql_fetch_row($res))
{
echo "$row[0]";
}
?>