bilis_money Posted October 22, 2007 Share Posted October 22, 2007 How do you call a php function from javascript. let say i have a php function like this below; function myfunc() { etc... } now i have javascript below using onmouover(); <a href="" onmouseover=""> <img src="mypicture.jpg" width="" height="" border="2"/> </a> what is the proper way to insert php myfunc() inside javascript onmouseover() function. So that i can call the php function. is this correct below? <a href="" onmouseover="<?php myfunc(); ?>"> I have not tested that so i'm not sure if it is correct. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/74302-calling-php-function-from-javascript/ Share on other sites More sharing options...
MadTechie Posted October 22, 2007 Share Posted October 22, 2007 your need to use AJAX Read up on Ajax, Ajax freaks tut, Quote Link to comment https://forums.phpfreaks.com/topic/74302-calling-php-function-from-javascript/#findComment-375395 Share on other sites More sharing options...
bilis_money Posted October 22, 2007 Author Share Posted October 22, 2007 any basic sample for this case please i'm not that good in ajax yet. thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/74302-calling-php-function-from-javascript/#findComment-375420 Share on other sites More sharing options...
GingerRobot Posted October 22, 2007 Share Posted October 22, 2007 Well, what are you actually trying to do? I can't see why you'd need to do something php onmouseover. Whats the goal? Quote Link to comment https://forums.phpfreaks.com/topic/74302-calling-php-function-from-javascript/#findComment-375433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.