我想在这里实现的是,当用户在下面的文本框中输入数据时,如何将文本框的值传递到“金额”?
顺便说一句,它适用于Joomla数据库..
<input type="text" id="amount" name="amount" value=0 value="<?php $session =& JFactory::getSession(); $session->set('amount', ''); ?>"/>
答案 0 :(得分:1)
$_POST['amount']
(输入标记的名称)获取值$_SESSION['amount'] = $_POST['amount']
。或者您可以在代码示例中使用Joomla语法:$ session =&amp; JFactory ::的getSession();
$session->set('amount', $_POST['amount'])
答案 1 :(得分:0)
将POST值设为
$amount = JRequest::getInt('amount'); //filtered as INT
$amount = JRequest::get('amount');
通用
JRequest::get('post'); //all var send via post method
JRequest::get(); //all var send via post or get method. If u too lazy
对于会话检查以下链接: http://docs.joomla.org/How_to_access_session_variables_set_by_an_external_script http://ostraining.com/howtojoomla/how-tos/development/how-to-use-sessions-in-joomla