I’ve never met such approach before, but I’m wondering why nothing happens after clicking the “Say hello” button.
<html>
<head>
</head>
<body>
<button onclick="myscript.php">Say hello</button>
</body>
</html>
<?php
echo "Hello";
?>
It would look very “bombastic” if I used the “form” markup construction in this case.
Could you point out my mistake? Or if my vision is totally hopeless, what are the unconventional ways to run the php script?
Why are you using onclick?
onclickexecutes javascript code.Just link to the file
If you must use javascript, you have to redirect to that page using something like
window.locationHere’s a tutorial on redirecting with javascript