I have this:
var postData = {};
$('#items tr').not(':first').each(function(index, value) {
var keyPrefix = 'data[' + index + ']';
postData[keyPrefix + '[index]'] = index;
postData[keyPrefix + '[supp_short_code]'] = $(this).closest('tr').find('.supp_short_code').text();
postData[keyPrefix + '[project_ref]'] = $(this).closest('tr').find('.project_ref').text();
postData[keyPrefix + '[om_part_no]'] = $(this).closest('tr').find('.om_part_no').text();
postData[keyPrefix + '[description]'] = $(this).closest('tr').find('.description').text();
postData[keyPrefix + '[quantity_input]'] = $(this).closest('tr').find('.quantity_input').val();
postData[keyPrefix + '[cost_of_items]'] = $(this).closest('tr').find('.cost_of_items').text();
postData[keyPrefix + '[cost_total_td]'] = $(this).closest('tr').find('.cost_total_td').text();
});
What would be my next step to send this to PHP, i dont want to use Ajax because i need to go the PHP page and view the received results. The idea is to take values from a table, when the user presses “Preview” it will take these values and take them to a PHP page which i will have have set up an Invoice style page which i will populate with the above values?
Thanks
The logic doesnt seem too clear here- at present it seems you use JS to query your DB based on some criteria, assign the results to arrays then push the results to a PHP page to output them?
Instead of sending the resultset via GET/POST to the page, why dont you send ONLY whatever variables you use to construct your initial criteria, then on the PHP preview page, use PHP to query the DB, get the results and show them.
You should always try to refrain from sending a complete resultset via GET/POST to another page, you should aim to only send operators which help you either get or create the resultset.