$('#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?
asked Jul 17, 2011 at 11:25
3cross
1,1552 gold badges11 silver badges12 bronze badges
-
You need to install a php runtime with javascript bindings into your browser first to exectue PHP inside javascript.hakre– hakre2011年07月17日 11:27:45 +00:00Commented Jul 17, 2011 at 11:27
-
1I think you are looking for ajaxSascha Galley– Sascha Galley2011年07月17日 11:28:10 +00:00Commented Jul 17, 2011 at 11:28
-
possible duplicate of How to access PHP methods inside a Javascript?hakre– hakre2011年07月17日 11:29:35 +00:00Commented Jul 17, 2011 at 11:29
-
@Sascha Galley: If you think that far, please add a duplicate as well ;)hakre– hakre2011年07月17日 11:30:20 +00:00Commented 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.3cross– 3cross2011年07月17日 11:31:09 +00:00Commented Jul 17, 2011 at 11:31
1 Answer 1
JavaScript runs on the client, PHP on the server.
The only way to "call" PHP from your JavaScript is to use techniques like AJAX.
answered Jul 17, 2011 at 11:28
Mat
208k41 gold badges409 silver badges423 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default