Welcome Guest, Not a member yet? Register   Sign In
URI Segment question
#1

[eluser]pmonty[/eluser]
I am running CI on a windows server box. I am using the ? syntax in my url's.
For example: mysite.com/index.php?/mytest

This works fine to call the controller which is shown below.
Code:
<?php
class Mytest extends Controller {
  function index()
  {
    if ($this->uri->segment(2) === FALSE) {
      $period = 1;
    } else {
      $period = $this->uri->segment(2);
    }
    echo $period;
  }
}
?>
However, this url mysite.com/index.php?/mytest/2 gives a page not found 404 error.
Shouldn't the mytest controller be called and processed? What am I missing?

Paul
#2

[eluser]Michael Wales[/eluser]
Yes, the mytest class is being called, but you are attempting to call a method named 2.

URLs are: domain.com/class/method/param1/param2/param3/etc/etc/etc
#3

[eluser]pmonty[/eluser]
That was it! Thanks so much.

Paul




Theme © iAndrew 2016 - Forum software by © MyBB