karontte Posted October 20, 2007 Share Posted October 20, 2007 hi, need help with a simple question, it's possible to call this function on a blank page: <? require('inc_rate.php'); getComments("1"); submitComments("1","$PHP_SELF"); ?> using a html image button? Quote Link to comment https://forums.phpfreaks.com/topic/74074-calling-php-function-with-a-button/ Share on other sites More sharing options...
ignace Posted October 20, 2007 Share Posted October 20, 2007 so you wan't to execute that code when someone presses a button? <?php if (isset($_POST["mybutton"])) { require('inc_rate.php'); getComments("1"); submitComments("1",$PHP_SELF); } ?> <form action="" method="post" enctype="application/x-www-urlencoded"> <input type="submit" name="mybutton" value="press" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/74074-calling-php-function-with-a-button/#findComment-373940 Share on other sites More sharing options...
Ninjakreborn Posted October 20, 2007 Share Posted October 20, 2007 Oh you mean click on a button and throw a php function. With ajax you can. Quote Link to comment https://forums.phpfreaks.com/topic/74074-calling-php-function-with-a-button/#findComment-373962 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.