How to insert form data into an array? PHP?
This is the array at present...
"amount" => 5000,
"currency" => "GBP",
"description" => "Description of Product",
"source" => $token,
I need the price and description to be variable, based on hidden input fields from the submitting form. I tried this..
"amount" => (isset($_POST["dataprice"]))?$_POST["dataprice"]:"",
"currency" => "GBP",
"description" => " . "(isset($_POST["datadesc"]))?$_POST["datadesc"]:"" . ",
"source" => $token,
..but am getting syntax error messages all over the place and, of course, it doesn't work. Thing is, I've copied this form data insertion into PHP from another application that I've worked on before that works really well. The only difference is that in that code, each line ends with a ; not a ,
Hope you can help.
Thank you.
NJ