Creation of an array of values from the database and transition to the form
I want to create an array of values taken from a DB and feed them to a form. I have a set of functions that calculate and retrieve results:
$uid = $current_user->ID;
$user_email = $current_user->user_email;
$oid = $_GET['oid'];
$order_total = walleto_get_total_for_order($oid);
All features have been tested and work well.
- How do I create an array of values?
- How to accept values and insert them into FORM and send?
------- This is a request for solution after tests on the question here - not allowed --------- -
0
source to share
1 answer
Creating an array is pretty simple:
$myarray = array() ;
$myarray['uid'] = $current_user->ID;
$myarray['user_email'] = $current_user->user_email;
$myarray['oid'] = $_GET['oid'];
$myarray['order_total'] = walleto_get_total_for_order($oid);
Then you don't insert the values into the form, you set them as values and they will be submitted when the user clicks the submit button
0
source to share