Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you're using mod_rewrite to remove the index.php file, you can use the following code to obtain the GET variables (via $this->input->get()). Assuming the default configuration, name the file MY_Input.php and place it in your application/libraries directory.</p> <p>Usage: $this->input->get()</p> <p> <pre><code>class MY_Input extends CI_Input { function My_Input() { parent::CI_Input(); // allow GET variables if using mod_rewrite to remove index.php $CFG =&amp; load_class('Config'); if ($CFG-&gt;item('index_page') === "" &amp;&amp; $this-&gt;allow_get_array === FALSE) { $_GET = $this-&gt;_get_array(); } } /** * Fetch an item from the GET array * * @param string $index * @param bool $xss_clean */ function get($index = FALSE, $xss_clean = FALSE) { // get value for supplied key if ($index != FALSE) { if (array_key_exists(strval($index), $_GET)) { // apply xss filtering to value return ($xss_clean == TRUE) ? $this-&gt;xss_clean($_GET[$index]) : $_GET[$index]; } } return FALSE; } /** * Helper function * Returns GET array by parsing REQUEST_URI * * @return array */ function _get_array() { // retrieve request uri $request_uri = $this-&gt;server('REQUEST_URI'); // find query string separator (?) $separator = strpos($request_uri, '?'); if ($separator === FALSE) { return FALSE; } // extract query string from request uri $query_string = substr($request_uri, $separator + 1); // parse query string and store variables in array $get = array(); parse_str($query_string, $get); // apply xss filtering according to config setting if ($this-&gt;use_xss_clean === TRUE) { $get = $this-&gt;xss_clean($get); } // return GET array, FALSE if empty return (!empty($get)) ? $get : FALSE; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload