What I'm trying to do is navigate to another page using a php script, so when I press the button it should change pages, but that's not what happens. Here is my code:
<script>
function changeScreen() {
<?php
header('Location: index.php');
exit();
?>
}
</script>