I tried to call php function from javascript the code is shown below,
<html>
<head></head>
<body>
<script type="text/javascript" >
function header()
{
<?php
header("Location:http://www.google.com");
?>
}
</script>
<br/><input type="button" onclick= "header();" value="Google" />
</body>
</html>
When I run this code before, i.e click the button, the page is automatically directed to www.google.com , my requirement is clicking on the button and directing to the respective page, What is wrong in thi code?