I want to call the PHP function declaration and call by clicking the button. how can I write this function? why don't I write onclick = "return & nbsp; check () in time () when the jump is over, he just executed it. & lt; html & gt; & lt; body & gt; & lt; button & nbsp; typ has a small problem about PHP function declaration and calling.
I want to call and execute this function by clicking the button. how can I write this function? why didn't I write onclick = "return check () in time? he just ran it.
Function check ()
{
If ($ name === _ SESSION ['username'] | $ name = "0000 ")
{
$ SQL = "DELETE FROM lostMsg WHERE msgID = '$ msgID '";
$ Result = mysql_query ($ sql1, $ conn );
If ($ result = true)
{
Echo "script window. alert ('deleted successfully! ') Script ";
Echo "script window. location. href = 'xunwu _ More. php' script";
}
}
Else
Echo "script window. alert ('you do not have this permission! ') Script ";
}
?>
------ Solution --------------------
Onclick is executed on the client.
Your requirements must be post/get to the server or ajax.
------ Solution --------------------
">