[jQuery] jQuery and $.post with PHP and $_POST
How do I get PHP to print JavaScript variables via $_POST? jQuery's
$.post doesn't seem to be submitting any data.
This is a sample of what I have...
test.php:
--------------
<?php
echo '<pre>';
print_r($_POST);
echo '</pre';
?>
<form method="post" action="test.php" id="test">
<input id="submit" name="submit" type="submit" value="Submit">
</form>
--------------
jquery.js:
--------------
$(document).ready(function()
{
$("form#test").bind('submit',(function(){
$.post("test.php",{
// no matter what I put in here, nothing shows up in test.php
});
});
});
--------------
I've also tried:
$("form#test").submit(function(){
instead of bind...