I'm trying to call php function "funct1()" from javascript. I'm calling javascript function "clicked()" from button onclick. The problem is when i click the button in php function doesn't return value to "someVariable".
<?php
function funct1()
{
if(isset($_GET['cmbcode']))
{
$name = $_GET['cmbcode'];
echo $name;
}
}
?>
<script type='text/javascript'>
function clicked()
{
var someVariable="<?php echo funct1(); ?>";
alert(someVariable);
}
</script>