我在这里想要实现的是,当用户在下面的文本框中输入数据时,如何将文本框的值传递给“金额”?
顺便说一句,它是为 Joomla 数据库..
<input type="text" id="amount" name="amount" value=0 value="<?php $session =& JFactory::getSession(); $session->set('amount', ''); ?>"/>
$_POST['amount']
(输入标签的名称)获取值$_SESSION['amount'] = $_POST['amount']
。或者您可以在代码示例中使用 Joomla 语法:$session =& JFactory::getSession();
$session->set('amount', $_POST['amount'])
获取 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