Welcome Guest, Not a member yet? Register   Sign In
Basic index($variable) question for creating a site like www.mysite.com/username
#1

[eluser]AlanW[/eluser]
www.mysite.com works fine by directing content to a Main controller by rewriting the URL

Now, I'm trying to get a site looking like twitter, such that my username is passed through as $variable to index

In my default controller, which is Main, I have

class Main extends CI_Controller {

public function index($username=null) {
… code
}

}


The code runs fine only when I eliminate the ($username=null) and just go with index(). With the $username, I get a 404. I've checked the UG but stumped!

Thanks in advance!


Messages In This Thread
Basic index($variable) question for creating a site like www.mysite.com/username - by El Forum - 11-12-2012, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB