PHP: processing method for obtaining the current URL path (applicable to multi-condition filtering list) and url Processing Method
Example:
<? Php/*** PHP: Obtain the function of the current url path and the SERVER variable * $ _ SERVER ["QUERY_STRING"] query (query) * $ _ SERVER ["REQUEST_URI"] URI required to access this page * $ _ SERVER ["SCRIPT_NAME"] contains the path of the current script * $ _ SERVER ["PHP_SELF"] the file name of the script being executed * applies to filtering multiple conditions in the list, for example: price, time, type, etc. * @ author liuxinming */header ("Content-type: text/html; charset = UTF-8 "); if ($ url_string = $ _ SERVER ['query _ string']) {/** strpos function returns the position where the string first appears in another string */$ url_string = substr ($ url_string, (st Rpos ($ url_string ,"? "); // Return? Subsequent string results: name = liuxinming & type = 1parse_str ($ url_string, $ url); // parse the returned string to the variable result: array ('name' => 'liuxin', 'type' => 1) foreach ($ url as $ field => $ value) {/** rawurlencode encodes a string into a URL-specific format */$ add [] = $ field. '= '. rawurlencode ($ value); if ($ field = 'name') {echo "filtering SQL conditions by name field ";}//.... perform different URL filtering based on various situations // then assemble the multi-condition query conditions selected by the current user. // then assemble the flip URL // finally, a multi-condition filtering list is completed, the general logic is like this. If anything is wrong, please kindly advise.}?>
The above PHP method for obtaining the current URL path (applicable to the multi-Filter list) is all the content shared by the editor. I hope you can give it a reference, we also hope that you can support the customer's home.