I'm so new on Php and HTML. I have a problem about calling function. I think I've done what i read on other articles but it's obvious i miss something.
My file is "login.php". I try to call a function by onclick method but it doesn't work.
My button to call the function:
<button type="submit" class="btn btn-warning" style="margin-right: 10px;margin-top: inherit;" onclick="signin()">Sign In</button>
My function:
<script>
function signin() {
<?php echo "hello"; ?>
};
</script>
When I click to the button, on console it says:
login.php:63 Uncaught ReferenceError: hello is not defined
Or I tried to write function like this:
<?php
function signin() { echo "hello"; };
?>
But now console says:
login.php:33 Uncaught ReferenceError: signin is not defined
I appreciate your helpful answers from now. Thank you!