Home>

First of all, the ci framework supports get after 2.0, so there is no pressure to use it!

1. Use get to pass parameters:

As follows:localhost/index.php/jb51/func/a/b

Then the method php code in the controller is as follows:

<?php
class jb51 extends ci_controller {
 public function func ($x, $y)
 {
  echo $x;
  echo $y;
 }
}
?>

As above:a and b are passed to the func method

2. Imagine if your parameters are very long,This method definitely won't work,ok, do this:

In config.php, set "uri_protocol" to

$config ["uri_protocol"]="path_info";

Add before $_get

parse_str ($_ server ["query_string"], $_get);

This way you can easily pass parameters in this way index.php/jb51/func&x63;x=a&y=b.

php
  • Previous thinkphp3x method to connect to the mysql database (specific steps)
  • Next Fifty-five of Manipulating Data in ASPNET 20: Editing and Deleting Existing Binary Data