Problem sending JS variables/array to PHP with jQuery.post() function

Problem sending JS variables/array to PHP with jQuery.post() function

Hi folks,

I'm having a big problem here. In fact, I guess I'm almost there, but there's a little something that keep me struggling. Here's my challenge:

I have a page (full url: http://uren.visueel-adv.be/overview, url with .htaccess: /overview) that carry a table with the performances/jobs from the employees in our company. The table is generated with PHP and MySQL and each table row contains the following data/cells:

- Performance ID (invisible)
- Date
- Customer
- Employee
- Begin time of the job
- End time of the job
- Total time worked on the job
- An empty checkbox

Underneath the table, I've put a form with a "Charge" button. This button gets all the selected rows (the row where the user checked the checkboxes) and places the id's from the selected jobs in a JS array. I've searched a lot to make this happen, but now, it realy works fine. Hooray for prevAll() and nextAll()!

Here's the form with the "Charge" button:

  1. <form action="#" method="post" id="charge">
  2.     <fieldset>
  3.         <p><button type="submit" name="submitCharge" id="submitCharge" title="Charge selection">Charge selection</button></p>
  4.     </fieldset>
  5. </form>

And here's the jQuery code that gets the id's and puts it in an JS array:

  1. var performanceIds = new Array();
  2. $('#charge #submitCharge').click(function(){
  3.     $('#report :checked').each(function(i){
  4.         performanceIds[i] = $(this).parent().prevAll('.invisible').text();
  5.     });
  6. });

The next thing I like to do is sending that JS array with those id's to PHP. Why? Because PHP should copy the performances/jobs with the corresponding ID's to another table and then delete those records in the original database table. Searching on Google teached me that I can do that with the jQuery.post() function. This is my latest try with that function (that didn't do the job):

  1. $.post("/overview", { name: "John", time: "2pm" } );
  2. return false;

As you can see, I've tried to send some other variables via POST to my PHP page. When I now click the "Charge" button, it seems to work, but I can't get the variables via underneath PHP code:

  1. echo '<p>Here comes the name: ' . $_POST['name'] . '</p>';
  2. echo '<p>Here comes the time: ' . $_POST['time'] . '</p>';

Very very strange, because in FireBug, I do see the POST parameters in the console:
Parameters
name    John
time      2pm
Scource
name=John&time=2pm




Perhaps, those variables aren't send at all? To check it out, I've erased the "return false", but then I've got the following error (for less then one second) in my FireBug:
... and it won't works too. I'm kind of desperate with this problem, so I hope someone can help me out with it. Is there anyone who 've got the same issue, or is there anyone who realy knows how that jQuery.post() function works? I would realy thank you guy's, you would save my life