CI uses multiple forms to raise traffic, but Masters can help you see what went wrong.
If (! Empty ($ _ POST ['num']) |
! Empty ($ _ POST ['title']) |
! Empty ($ _ POST ['price']) |
! Empty ($ _ POST ['ears']) |
! Empty ($ _ POST ['Season ']) |
! Empty ($ _ POST ['groupup'])
{
$ W = array (
Foreach ($ _ POST as $ k => $ v ):
If (! Empty ($ v )){
$ K => $ v;
}
Endforeach;
)
}
Just fail
Reply to discussion (solution)
What is the writing method? foreach in the array? Can this work?
This method is unknown.
I just want to do a multi-form search,
It is to restrict multiple search conditions at the same time. each condition is in the form of a single form,
There is a single-line text box or a drop-down menu, you can not limit all the conditions at the same time,
I don't know how to do this.
Why are multiple forms and multiple search conditions in one form not supported ???
Does not it filter out invalid (null) input items?
$w = array_diff($_POST, array('', 0));
You can.
Xuzuning!
You are my God, and worship the places you worship
If (! Empty ($ _ POST ['num']) |
! Empty ($ _ POST ['names']) |
! Empty ($ _ POST ['price']) |
! Empty ($ _ POST ['ears']) |
! Empty ($ _ POST ['Season ']) |
! Empty ($ _ POST ['groupup']) |
! Empty ($ _ POST ['note'])
{
$ W = array_diff ($ _ POST, array ('', 0 ));}
// Paging parameters, route coordination
$ Config ['base _ url'] = 'http: // localhost/ci/index. php/product/search ';
$ Num = $ this-> product_model-> search_page ($ w); // $ w is not defined during the call.
$ Config ['total _ rows '] = $ num;
$ Config ['per _ page'] = 80;
$ Config ['uri _ segment '] = '3 ';
$ This-> pagination-> initialize ($ config );
$ PageNum = $ this-> uri-> segment (3, 1 );
If ($ pageNum = 1 ){
$ Offset = 0;
} Else {
$ Offset = $ config ['per _ page'] * ($ pageNum-1 );
} // The paging parameter ends.
$ Data ['title'] = 'item Center ';
// $ _ Where = array ('type' => 'newstore ');
$ Data ['data'] = $ this-> product_model-> search_paging ($ w, $ config ['per _ page'], $ offset ); // $ w is not defined here.
$ W = array (); if ($ _ POST) {$ w = array_diff ($ _ POST, array ('', 0);} // paging parameter, route coordination .....
Master master
Thanks to xuzuning for helping our birds