Ken2k7 Posted May 3, 2009 Share Posted May 3, 2009 <form method="post"> <input type="submit" name="submit" value="submit" /> </form> <?php if (isset($_POST['submit'])) echo 'Hello World'; ?> That would do it. Link to comment https://forums.phpfreaks.com/topic/156588-how-do-i-use-buttons/page/2/#findComment-825226 Share on other sites More sharing options...
Pete C Posted May 3, 2009 Author Share Posted May 3, 2009 Thanks ken I will try it BUT could I push you to modify this code so that it uses a function? Many thanks Pete C Link to comment https://forums.phpfreaks.com/topic/156588-how-do-i-use-buttons/page/2/#findComment-825227 Share on other sites More sharing options...
Ken2k7 Posted May 3, 2009 Share Posted May 3, 2009 <?php function do () { echo 'Hello World'; } ?> <form method="post"> <input type="submit" name="submit" value="submit" /> </form> <?php if (isset($_POST['submit'])) do(); ?> Link to comment https://forums.phpfreaks.com/topic/156588-how-do-i-use-buttons/page/2/#findComment-825229 Share on other sites More sharing options...
Pete C Posted May 3, 2009 Author Share Posted May 3, 2009 Thanks Ken that will do nicely. Bit of a learning curve this php - and yes I have found W3 schools! Pete C. Link to comment https://forums.phpfreaks.com/topic/156588-how-do-i-use-buttons/page/2/#findComment-825234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.