Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i want do sonmthing like this ! How i can do it ?
HTML
<button style="width:250px;" id="enable_voiceChat" >">sent accept message</button>
<script>
function domessage()
{
//do some javaScript ...
}
</script>
Posted
Updated 30-Nov-14 0:35am
v2

1 solution

As your javascript code runs on client side and your php code runs on server side, and these two are not running at same time, you can not run php code on client side. What you can do is making a call from the client side to the server side to do some stuff. You have two choices: either you post a form and refresh the whole page, or you call an ajax backend with an ajax background call. This later approach is more common nowadays. I suggest you consult this tutorial: http://blog.teamtreehouse.com/beginners-guide-to-ajax-development-with-php[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900