问题
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
But i need to redirect it to index.php?option=com_mycomponent&task=search&searchword=test
it is not working either in sef enabled/disabled
when i type index.php?option=com_mycomponent&task=search&searchword=test
in url, i go to the desired page.
Please tell me where am i wrong
回答1:
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">
来源:https://stackoverflow.com/questions/18959813/joomla-2-5-form-redirection-error