Jump to content

can I call php function from javascript function ?


chirdeep_tomar

Recommended Posts

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 ???
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.com

And 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.