1. Home >
  2. Apps >
  3. Groups >

PHP: How to call a function on button click?

Question asked by komputergeek in #PHP on Aug 9, 2009
komputergeek
komputergeek · Aug 9, 2009
Rank C2 - EXPERT
Hi,
i am learning php these days.I want to know how to call a php function on button click.
Button is created in HTML and function is a php function.Give sample code if possible.
Please help me. Posted in: #PHP
itchap
itchap · Aug 9, 2009
Rank C1 - EXPERT
Re: help in PHP





Name




I think this will solve your problem. But if you still need further assistance than let me know please.........
komputergeek
komputergeek · Aug 9, 2009
Rank C2 - EXPERT
Re: help in PHP

itchap
I think this will solve your problem. But if you still need further assistance than let me know please.........

But in this case we will have to create seperate php file for each function.
Is there any way to write few php functions in one file and call one of them as required?
itchap
itchap · Aug 9, 2009
Rank C1 - EXPERT
Re: help in PHP

komputergeek
But in this case we will have to create seperate php file for each function.
Is there any way to write few php functions in one file and call one of them as required?
Yeah for this purpose you have to use the isset function i am giving you the syntax for that........

if(isset($_POST["submit']))
{

#Put Your code Here

}

?>
Put this at the top of the page. And all the code written in the if block will be work when the submit button is clicked.
komputergeek
komputergeek · Aug 11, 2009
Rank C2 - EXPERT
Re: help in PHP

Thanks.i will try tihs.

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up