0
$('#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?

6
  • You need to install a php runtime with javascript bindings into your browser first to exectue PHP inside javascript. Commented Jul 17, 2011 at 11:27
  • 1
    I think you are looking for ajax Commented Jul 17, 2011 at 11:28
  • possible duplicate of How to access PHP methods inside a Javascript? Commented Jul 17, 2011 at 11:29
  • @Sascha Galley: If you think that far, please add a duplicate as well ;) Commented Jul 17, 2011 at 11:30
  • how do i go about this the ajax for this then? I just need the page to go 2 page. One the paypal, another the php page which does database add. No values need to be send i just need it to went there as well. Commented Jul 17, 2011 at 11:31

1 Answer 1

4

JavaScript runs on the client, PHP on the server.

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.