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? 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> 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. 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
Archived
This topic is now archived and is closed to further replies.