First, relevant code:
View
<div id="search">
<?= form_open('sheet/search') ?>
<?= form_input('search_query', '', 'id="search_query" placeholder="Search Sheet Music"') ?>
<?= form_submit('submit', 'Search!', 'class="hidden"') ?>
<?= form_close() ?>
</div>
Controller sheet/search
public function search()
{
if ($this->input->post('search_query'))
{
// blah
// [ ... ]
$_POST
is completely empty.
What on earth? The annoying thing is, other forms work perfectly fine on my website. Furthermore, this works perfectly on my testing server... so I'm guessing there's something wonky with my configuration files, .htaccess, or something. However, I don't know what could be causing it.
If you have an idea and need more information, feel free to specify. I just have no idea where to look, or what to change! Any help would be hugely appreciated.
Thanks!
EDIT 1/8/2013
Okay, I made a discovery. When my index page is removed from config/config.php, the search does not work. However, when it is added, it DOES work.
It still doesn't make any sense.
Below is my .htaccess file. Think I need to modify it somehow? I have absolutely no idea why it's not working still, but this is a step in the right direction.
RewriteEngine on
RewriteCond $1 !^(index.php|images|assets|sheet|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…