chirdeep_tomar Posted January 4, 2007 Share Posted January 4, 2007 i need to create create php session and i want to define that code in a php function. basically i wann call this php function to create a session. but as we can not call php function from html button events, however i can call javascript function from html. i m looking is there a way that i can call php function from javascript ??? Link to comment https://forums.phpfreaks.com/topic/32779-can-i-call-php-function-from-javascript-function/ Share on other sites More sharing options...
tomfmason Posted January 4, 2007 Share Posted January 4, 2007 Well there are a couple ways that you could do this.. You could us JSON, Ajax or some type of dynamic script.. I would suggest for it's ease of use, Ajax.You may want to look at the tutorials at http://ajaxfreaks.comAnd to answer your question.. You cannot call a server side function from the client.. So basically you cannot call a php function directly from the script.. But you can send post/get requests to another file..Good Luck,Tom Link to comment https://forums.phpfreaks.com/topic/32779-can-i-call-php-function-from-javascript-function/#findComment-153028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.