<html>
    <?php
        $num = 1;
        echo $num;
    ?>
    <input type="button"
           name="lol" 
           value="Click to increment"
           onclick="Inc()" />
    <br>
    <script>
        function Inc()
        {
        <?php
            $num = 2;
            echo $num;
        ?>
        }
    </script>
</html>
This is what i have so far, not working though, i think i need to use ajax or something but i have no idea what to do.
Thanks
 
     
     
     
     
     
     
     
     
     
     
     
     
    