3cross
3cross

Reputation: 1155

How do i put php function inside a javascript onclick function?

$('#submit').click(function(event){
         //code to do php include(otherpage.php)
     });

How am i able to archieve this with a submit button with id=submit?

Upvotes: 0

Views: 405

Answers (1)

Mat
Mat

Reputation: 206679

JavaScript runs on the client, PHP on the server.

The only way to "call" PHP from your JavaScript is to use techniques like AJAX.

Upvotes: 4

Related Questions