how to call a php function on button click
<p>These are two files</p>

<p>Calling.php</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;form action="Called.php" method="get"&gt;
    &lt;input type="button" name="B1" value="B1"&gt;
    &lt;input type="button" name="B2" value="B2"&gt;
    &lt;input type="Submit" name="Submit1"/&gt;

    &lt;!-- &lt;a href="http://www.google.com?act=google"&gt;Google&lt;/a&gt;
    &lt;a href="http://www.yahoo.com?act=yahoo"&gt;yahoo&lt;/a&gt;
     --&gt;
&lt;/form&gt;     
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And Called.php</p>

<pre><code>&lt;?php
if(isset($_GET("Submit1")))
{   
        echo("&lt;script&gt;location.href = 'http://stackoverflow.com';&lt;/script&gt;");
}
if(isset($_GET["B1"]))
{
    echo("&lt;script&gt;location.href = 'http://google.com/';&lt;/script&gt;");
    exit();
} 
if(isset($_GET["B2"]))

 - List item

{
    echo "&lt;meta http-equiv='refresh' content='0;url=http://www.yahoo.com'&gt;";
    exit(); 
}
?&gt;
</code></pre>

<p>When i click the buttons "B1" and "B2", page will blink but now where redirect and third one "Submit" button will redirect to new page and there i am getting the out put as "Called.php".</p>

<p>Please spend few seconds for this php beginner.</p>
