I have a form, I have successfully passed the username from jquery

$.post("http://www.photographycourses.co.uk/cpl/cplfunctions.php?action=checkUsername", { username: username} );

to php script. The php script checks the database to see if the username exists:

if ($num >=1){	
echo= 0;		
}else{		
echo= 1;			}

How do I pass the variable (1/0) back to the javascript file?

Follow the sample to know how to pass php variable to javascript:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Pass PHP value to JAVASCRIPT</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
</head>
<body bgcolor='#f1f1f1' text='#000000' link='#33cc00' alink='#33cc00' vlink='#33cc00'>
	<?php
		for($i=0; $i<20; $i++)
	{?>
	<script type = 'text/javascript'>
		var hp="<?php echo $i; ?>";
		alert (hp);
		</script>
	<?php
	}
	?>
</body>
</html>