i need to make a page that have a button , when i press that button , a javascript function call a php function who run a mysql_query and print on page the results! How can i run php function from javascript .
            Asked
            
        
        
            Active
            
        
            Viewed 90 times
        
    -3
            
            
        - 
                    2Use Ajax to achive this. – vaso123 Dec 30 '14 at 15:05
- 
                    What did Google have to say? – Funk Forty Niner Dec 30 '14 at 15:05
- 
                    1http://api.jquery.com/jquery.ajax/ – gbestard Dec 30 '14 at 15:05
- 
                    http://stackoverflow.com/questions/13840429/reference-why-does-the-php-or-other-server-side-code-in-my-javascript-not-wor – John Dvorak Dec 30 '14 at 15:07
- 
                    Possible duplicate of [Executing a php script in javascript?](http://stackoverflow.com/questions/5227132/executing-a-php-script-in-javascript) – Patrick Evans Dec 30 '14 at 15:10
1 Answers
0
            You have http://api.jquery.com/jquery.ajax/ :
    $.ajax({
       url : 'script.php'
    });
 
    
    
        Clément Andraud
        
- 9,103
- 25
- 80
- 158
