Eggzorcist Posted August 6, 2009 Share Posted August 6, 2009 What is the easiest way to submit information through a submit button to execute a function? Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/169079-submiting-data-using-a-function/ Share on other sites More sharing options...
trq Posted August 6, 2009 Share Posted August 6, 2009 if (isset($_POST['submit'])) { callfunctionfoo(); } Link to comment https://forums.phpfreaks.com/topic/169079-submiting-data-using-a-function/#findComment-892060 Share on other sites More sharing options...
Eggzorcist Posted August 6, 2009 Author Share Posted August 6, 2009 I've tried this - but it seems it doesn't work for me. Maybe it's a php.ini setting or something. I'm using MAMP Pro. And for the form I use post and <?php $_SERVER['PHP_SELF'] ?> ? Link to comment https://forums.phpfreaks.com/topic/169079-submiting-data-using-a-function/#findComment-892069 Share on other sites More sharing options...
watsmyname Posted August 6, 2009 Share Posted August 6, 2009 I've tried this - but it seems it doesn't work for me. Maybe it's a php.ini setting or something. I'm using MAMP Pro. And for the form I use post and <?php $_SERVER['PHP_SELF'] ?> ? Try this <?php if($_POST) { callfunctionfoo(); } ?> Link to comment https://forums.phpfreaks.com/topic/169079-submiting-data-using-a-function/#findComment-892072 Share on other sites More sharing options...
trq Posted August 6, 2009 Share Posted August 6, 2009 In order for my code to work your submit button needs to have the name attribute set to 'submit' Link to comment https://forums.phpfreaks.com/topic/169079-submiting-data-using-a-function/#findComment-892086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.