SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: simple question

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple question

    I have .php function call activeNow(); and button for it.

    Code:
    at php script :
    <?php
    public function activeNow() {
       echo 'hello world';
    }
    ?>
    
    
    at design script :
    <button onclick = "call_now();" >Active !!</button>
    
    at javascript : 
    <script>
    function call_now() {
    }
    </script>
    my question is, what should I must write into javascript if I press the Active!! button, then It will call activeNow() from php script ??

    thanks

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to use XMLHttpRequest to execute the php script and return the text

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi @DanSEO, thanks for your reply,
    but could you give some clue ?

    thanks,

  4. #4
    SitePoint Guru SSJ's Avatar
    Join Date
    Jan 2007
    Posts
    828
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What basically you want to achieve?

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just want to know the code,

    maybe you can help me to find the article or pdf about it !!

    thanks

  6. #6
    SitePoint Guru SSJ's Avatar
    Join Date
    Jan 2007
    Posts
    828
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can achieve it via XMLHTTPREQUEST and we can say Ajax.

    You can refer following URL:
    http://www.w3schools.com/AJAX/ajax_source.asp

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks bro,

    hm, sometimes its hard to make it by myself you know, even though there is no code here eventually, anyway thanks


Bookmarks

Posting Permissions

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