Skip to content
Advertisement

Retrieve post array values

I have a form that sends all the data with jQuery .serialize() In the form are four arrays qty[], etc it send the form data to a sendMail page and I want to get the posted data back out of the arrays.

I have tried:

JavaScript

And tried this:

JavaScript

Is this the correct approach?

Advertisement

Answer

You have [] within your $_POST variable – these aren’t required. You should use:

$qty = $_POST['qty'];

Your code would then be:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement