Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. calling a php function through onclick

calling a php function through onclick

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
phpquestion
6 Posts 4 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    umeshdaiya
    wrote on last edited by
    #1

    is it possible to call a php function with in onclick event? if its possible how i can do this? :-D

    M 1 Reply Last reply
    0
    • U umeshdaiya

      is it possible to call a php function with in onclick event? if its possible how i can do this? :-D

      M Offline
      M Offline
      Mohammad Dayyan
      wrote on last edited by
      #2

      Yes, Definitive. Well, when you're sending your form to server side, in the server side check whether the button define or not.

      <?php

      if (isset($_REQUEST['buttonName']))
      func();

      function func()
      {
      ...
      }

      ?>

      U 1 Reply Last reply
      0
      • M Mohammad Dayyan

        Yes, Definitive. Well, when you're sending your form to server side, in the server side check whether the button define or not.

        <?php

        if (isset($_REQUEST['buttonName']))
        func();

        function func()
        {
        ...
        }

        ?>

        U Offline
        U Offline
        umeshdaiya
        wrote on last edited by
        #3

        but how to call a function through button onclick this function. :-D

        P 1 Reply Last reply
        0
        • U umeshdaiya

          but how to call a function through button onclick this function. :-D

          P Offline
          P Offline
          Perspx
          wrote on last edited by
          #4

          You'd have to use AJAX for that and make a request to the server, to a PHP page, (using JavaScript) process the request with your PHP script then return some data back to the page and do with it what you want with JavaScript. Regards, --Perspx

          "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
          "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

          C 1 Reply Last reply
          0
          • P Perspx

            You'd have to use AJAX for that and make a request to the server, to a PHP page, (using JavaScript) process the request with your PHP script then return some data back to the page and do with it what you want with JavaScript. Regards, --Perspx

            "I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
            "Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds

            C Offline
            C Offline
            chiangkinghu
            wrote on last edited by
            #5

            I also want know it? thanks! www.igolfyoo.com[^]

            C 1 Reply Last reply
            0
            • C chiangkinghu

              I also want know it? thanks! www.igolfyoo.com[^]

              C Offline
              C Offline
              chiangkinghu
              wrote on last edited by
              #6

              i just want to say www.igolfyoo.comwith PHP,but i don't now how to amend! Can you help me? Thanks!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups