dsjxgu4759 2012-06-07 11:23
浏览 6

too long

I need to make some modification in joomla module. I need a select box which select value from database when user select value from that database it redirect user to another page. which show result of that page. I am able to generate select box with value from database now how i can redirect it to another page of joomla. Here is code that i used:

<?php
$db = JFactory :: getDBO();
$query = "select * from #__galleries where parent=0 order by date";
$db->setQuery($query);
$result = $db->loadObjectList();
$options = array();
$options[] = JHTML::_('select.option', '0', '-Select Gallery-');
foreach($result as $row)
{
$options[] = JHTML::_('select.option', $row->id, $row->name);
}
$dropdown = JHTML::_('select.genericlist', $options, 'class="inputbox"', 'name="select"', 'value', 'text');
echo $dropdown; 
?>
  • 写回答

1条回答 默认 最新

  • dongmaomou4117 2012-06-07 16:17
    关注

    Think this code should work. Obviously you will need to adapt it to your needs:

    $this->setRedirect( 'LINK_GOES_IN_HERE', $options);
    

    Hope this helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真