If I have something like this
$.post("<?php localhost/site/foo/1123?>", callBackFoo);
It passes 1123 to foo function and foo function echos something back to callBackFoo
I want to know how I would add another parameter to foo so it take 1123 as arg1 and something else as arg2
Thanks in advance.
It's unclear how you're handling your variables.
Can't you just do localhost/site/foo?arg1=123&arg2=456
Then get the arguments in PHP using $arg1 = $_GET['arg1'];
Just read jQuery API documentation:
Example: Request the test.php page and send some additional data along (while still ignoring the return results).
$.post( "test.php", { name: "John", time: "2pm" } );
Example: Pass arrays of data to the server (while still ignoring the return results).
$.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } );