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 ???
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.