创建从DB值的数组并传递到一个表单 [英] Creating an Array of values from DB and passing into a Form

查看:135
本文介绍了创建从DB值的数组并传递到一个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建从数据库中获得的值的数组,并将其传递到表单。
我有一组计算功能,并获取结果:

I want to create an array of Values taken from the DB and pass them into a Form. I have a set of functions that calculate and fetch results:

$uid = $current_user->ID;
$user_email = $current_user->user_email;
$oid = $_GET['oid'];
$order_total = walleto_get_total_for_order($oid); 

所有的功能已经过测试,做工精良。

All functions have been tested and work well.


  1. 如何创造价值的一个数组?

  2. 如何取的值,并将其粘贴到一个表格并发送?

-------这是解决方案的测试后,从<一个问题的请求href=\"http://stackoverflow.com/questions/27730632/echo-a-function-value-wont-pass-on-a-form\">here - 不解决----------

------- This is the a request for solution after tests on the question from here - not resolved ----------

推荐答案

创建一个数组很简单:

$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 "paste" the values into a form, you set them as values and they will be sent when the user click on the submit button

这篇关于创建从DB值的数组并传递到一个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆