OK i have this code
HTML:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"> </script>
<script type="text/javascript">
function get() {
$.post('tt.php',
{
$('#name')
},
function(output) {
$('#age').html(output).show();
});
}
</script>
</head>
<body>
<input type="text" id="name" name="name"/>
<a href="javascript:get()">haller</a>
<div id="age"></div>
</body>
</html>
and then this php file.
PHP:
<?
$name=$_POST['name'];
if ($name=="juliver")
{
echo "haller";
}
elseif ($name==NULL)
{
echo "Please put a name!";
}
else
{
echo "wrong name";
}
?>
the scenario is this, whatever value that the input has, it will be pass into the php file using the jquery of course as you can see, whenever the user clicks on the anchor tag which has the get() function and then the php file process the data (execute) and then pass it back to the jquery and then the jquery will output the data into the html. as of right now, i cant make this thing work. plesae help me. thanks in advance.
1 Answer