简体   繁体   English

Joomla 2.5表单重定向错误

[英]Joomla 2.5 form redirection error

Here is my form 这是我的表格

<form name="form1" action="<?php echo JRoute::_('index.php?option=com_mycomponent&task=search')?>" method="get">            
<input id="search_key" name="searchword" type="text" class="inputbox" placeholder="Enter Keyword/Part Number..." autocomplete="off">
<input type="submit" class="inputbutton" value="Search">
</form>  

After entering any keyword say 'test', it redirects to index.php?searchword=test 输入任何关键字说“测试”后,它将重定向到index.php?searchword = test

But i need to redirect it to index.php?option=com_mycomponent&task=search&searchword=test 但是我需要将其重定向到index.php?option=com_mycomponent&task=search&searchword=test

it is not working either in sef enabled/disabled 在启用/禁用sef中均不起作用

when i type index.php?option=com_mycomponent&task=search&searchword=test in url, i go to the desired page. 当我在url中键入index.php?option=com_mycomponent&task=search&searchword=test时,我转到所需的页面。

Please tell me where am i wrong 请告诉我我哪里错了

Can you try changing: 您可以尝试更改:

<form name="form1" action="<?php echo JRoute::_('index.php')?>" method="get">

to

<form name="form1" action="<?php echo JRoute::_('index.php')?>" method="get">
<input type="hidden" name="option" value="com_mycomponent">
<input type="hidden" name="task" value="search">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM