www.webdeveloper.com
Results 1 to 3 of 3

Thread: Calling function using button....

  1. #1
    Join Date
    Dec 2004
    Posts
    54

    Calling function using button....

    can anybody pls help me....
    how can i call a PHP script or function by using button?
    for example, i have this PHP script
    <HTML>
    <?
    function func(){
    $rv="PHP Script";
    return $rv;

    //button script here.
    }
    ?>
    </HTML>

    what should i do next if I want the function 'func' to be called
    by pressing button...by the way, the button script should reside inside the PHP script...

    tnx! in advance!!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    PHP runs on the server but buttons "run" in the browser. You have to submit the page (make a request) to get PHP code to run.

  3. #3
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,224
    Originally posted by ray326
    PHP runs on the server but buttons "run" in the browser. You have to submit the page (make a request) to get PHP code to run.
    Which means that the function is going to have to be called on page load because when the page is resent you are either going to be on a new page or the page you are on will be refreshing depending on the action.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles