I have a PHP page, which builds up a table in the php code, and then previews the table in the HTML code, like this basically:
<?php
$display="<table><tr><td></td></tr></table>"
?>
<HTML>
<?php echo $display; ?>
</HTML>
Now, I need to call a function INSIDE the php script again, whenever a button is clicked. Thing is, this button is created with the php before displaying it, like this:
<?php
function phpFunction(){ echo "Hello World"; }
$display="<table><tr><td><input type='button' onClick='phpFunction();'</td></tr></table>"
?>
<HTML>
<?php echo $display; ?>
</HTML>
But this doesn't seem to work... Is it possible to do what I want to do here?
If so, what's wrong in my code?
Thanks